PrefectHQ
prefect
BlogDocsChangelog

Add support for day_or parameter in cron schedule configurations

#19121Merged
Comparing
fix-19117-schedule-day-or-validation
(
aed9277
) with
main
(
1711fcc
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.3 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
459.2 µs460.3 µs

Ignored

bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-6%
4.1 ms4.4 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
171.1 ms170.8 ms
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+1%
161.6 ms159.4 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
2.6 ms2.6 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-9%
4.6 ms5.1 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-2%
106.1 ms108.4 ms

Commits

Click on a commit to change the comparison range
Base
main
1711fcc
-0.11%
Add support for day_or parameter in cron schedule configurations Fixes #19117 This PR adds support for the `day_or` parameter in cron schedule configurations defined in `prefect.yaml` deployment files. ## Problem When both `day_or` and `active` were defined in a deployment's cron schedule, the deployment would fail with a validation error. The `day_or` field works individually, but couldn't be used together with other schedule parameters. ## Root Cause The `RawScheduleConfig` model in `src/prefect/cli/deploy/_models.py` had `extra="forbid"` but was missing the `day_or` field, even though the underlying `CronSchedule` class supports it. This caused any schedule config with `day_or` to be rejected as invalid. ## Changes 1. Added `day_or` field to `RawScheduleConfig` model 2. Updated `_schedule_config_to_deployment_schedule` to extract and pass `day_or` to `CronSchedule` 3. Added comprehensive tests for `day_or` parameter handling ## Testing - Added unit tests for `RawScheduleConfig` with `day_or` - Added integration tests for full prefect.yaml validation - Added tests for schedule conversion with `day_or` - All existing tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
aed9277
18 hours ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs