properly check that output is dwh if not file
This commit is contained in:
parent
aa0919c790
commit
bcd9993723
1 changed files with 6 additions and 5 deletions
|
|
@ -40,11 +40,12 @@ def handle_get_rates_inputs(
|
||||||
if rates_source not in RATES_SOURCES:
|
if rates_source not in RATES_SOURCES:
|
||||||
raise ValueError(f"--rates-source must be one of {RATES_SOURCES.keys()}.")
|
raise ValueError(f"--rates-source must be one of {RATES_SOURCES.keys()}.")
|
||||||
|
|
||||||
# The Path constructor is idempotent, so this works equally fine if output
|
if not output == "dwh":
|
||||||
# is a string or an actual Path object.
|
# The Path constructor is idempotent, so this works equally fine if output
|
||||||
output = pathlib.Path(output)
|
# is a string or an actual Path object.
|
||||||
if output.suffix != ".csv":
|
output = pathlib.Path(output)
|
||||||
raise ValueError("Output must be a .csv file.")
|
if output.suffix != ".csv":
|
||||||
|
raise ValueError("File output must be a .csv file.")
|
||||||
|
|
||||||
prepared_inputs = {
|
prepared_inputs = {
|
||||||
"date_range": date_range,
|
"date_range": date_range,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue