diff --git a/rialto/runner/config_loader.py b/rialto/runner/config_loader.py index dea7b07..c4ce193 100644 --- a/rialto/runner/config_loader.py +++ b/rialto/runner/config_loader.py @@ -32,7 +32,7 @@ class IntervalConfig(BaseModel): class ScheduleConfig(BaseModel): frequency: str day: Optional[int] = 0 - info_date_shift: List[IntervalConfig] = IntervalConfig(units="days", value=0) + info_date_shift: Optional[List[IntervalConfig]] = IntervalConfig(units="days", value=0) class DependencyConfig(BaseModel): diff --git a/tests/runner/test_date_manager.py b/tests/runner/test_date_manager.py index 9088e0c..73b61b8 100644 --- a/tests/runner/test_date_manager.py +++ b/tests/runner/test_date_manager.py @@ -144,7 +144,7 @@ def test_run_dates_invalid(): [(7, "2023-02-26"), (3, "2023-03-02"), (-5, "2023-03-10"), (0, "2023-03-05")], ) def test_to_info_date(shift, res): - cfg = ScheduleConfig(frequency="daily", info_date_shift=IntervalConfig(units="days", value=shift)) + cfg = ScheduleConfig(frequency="daily", info_date_shift=[IntervalConfig(units="days", value=shift)]) base = DateManager.str_to_date("2023-03-05") info = DateManager.to_info_date(base, cfg) assert DateManager.str_to_date(res) == info @@ -155,7 +155,7 @@ def test_to_info_date(shift, res): [("days", "2023-03-02"), ("weeks", "2023-02-12"), ("months", "2022-12-05"), ("years", "2020-03-05")], ) def test_info_date_shift_units(unit, result): - cfg = ScheduleConfig(frequency="daily", info_date_shift=IntervalConfig(units=unit, value=3)) + cfg = ScheduleConfig(frequency="daily", info_date_shift=[IntervalConfig(units=unit, value=3)]) base = DateManager.str_to_date("2023-03-05") info = DateManager.to_info_date(base, cfg) assert DateManager.str_to_date(result) == info diff --git a/tests/runner/transformations/config.yaml b/tests/runner/transformations/config.yaml index 743a07f..3b72107 100644 --- a/tests/runner/transformations/config.yaml +++ b/tests/runner/transformations/config.yaml @@ -55,8 +55,8 @@ pipelines: frequency: weekly day: 7 info_date_shift: - value: 3 - units: days + - value: 3 + units: days - name: NamedDeps module: python_module: tests.runner.transformations