Skip to content

Commit

Permalink
fix arguments for timescale test
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Jan 7, 2025
1 parent 6696232 commit 7c4e45d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions alfalfa_worker/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ def to_bool(value: str):
true_strings = ["true", "yes", "1"]
if isinstance(value, bool):
return value
elif value.lower() in false_strings:
if value is None:
return False
elif value.lower() in true_strings:
return True
else:
raise ValueError(f"Invalid string \"{value}\" provided for boolean conversion")
if isinstance(value, str):
if value.lower() in false_strings:
return False
elif value.lower() in true_strings:
return True
raise ValueError(f"Invalid string \"{value}\" provided for boolean conversion")
2 changes: 1 addition & 1 deletion tests/worker/test_job_step_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def step_run_mock_job(dispatcher: Dispatcher):
"start_datetime": str(datetime(2019, 1, 2, 0, 0, 0)),
"end_datetime": str(datetime(2019, 1, 3, 0, 0, 0)),
"timescale": "20",
"realtime": None
"realtime": False
}

yield dispatcher.create_job(StepRunMockJob.job_path(), params)
Expand Down

0 comments on commit 7c4e45d

Please sign in to comment.