From bcd9993723177671450d8f2c74f3ecedf749f250 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 13 Jun 2024 15:59:13 +0200 Subject: [PATCH] properly check that output is dwh if not file --- xexe/inputs_handling.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xexe/inputs_handling.py b/xexe/inputs_handling.py index cab72c2..0cf5a75 100644 --- a/xexe/inputs_handling.py +++ b/xexe/inputs_handling.py @@ -40,11 +40,12 @@ def handle_get_rates_inputs( if rates_source not in RATES_SOURCES: raise ValueError(f"--rates-source must be one of {RATES_SOURCES.keys()}.") - # The Path constructor is idempotent, so this works equally fine if output - # is a string or an actual Path object. - output = pathlib.Path(output) - if output.suffix != ".csv": - raise ValueError("Output must be a .csv file.") + if not output == "dwh": + # The Path constructor is idempotent, so this works equally fine if output + # is a string or an actual Path object. + output = pathlib.Path(output) + if output.suffix != ".csv": + raise ValueError("File output must be a .csv file.") prepared_inputs = { "date_range": date_range,