Fix create_delta_data_intervals being ignored for timedelta schedules#69869
Open
sharetheknowledge wants to merge 2 commits into
Open
Fix create_delta_data_intervals being ignored for timedelta schedules#69869sharetheknowledge wants to merge 2 commits into
sharetheknowledge wants to merge 2 commits into
Conversation
_create_timetable() checked create_cron_data_intervals for both the cron-string branch and the timedelta/relativedelta branch, so create_delta_data_intervals had no effect and DAGs with a timedelta schedule silently followed the cron config instead. Closes apache#69868
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where
create_delta_data_intervalshad no effect on DAGs with atimedelta/relativedeltaschedule._create_timetable()intask-sdk/src/airflow/sdk/definitions/dag.pycheckedcreate_cron_data_intervalsfor both the cron-string branch and thetimedelta/relativedeltabranch. As a result:create_delta_data_intervalshad no effect at all — it's referenced nowhereelse in the codebase besides CLI config-list metadata and docs.
create_cron_data_intervalssilently controlled timetable selection fortimedelta/relativedeltaschedules too, which isn't what it's documentedto do (
config.ymldescribes it as governing only cron-string schedules).The
timedelta | relativedeltabranch now checkscreate_delta_data_intervalsinstead, matching
config.yml's documented behavior and making the two configkeys independent, as intended.
Added
test_timedelta_schedule_respects_create_delta_data_intervals_configintask-sdk/tests/task_sdk/definitions/test_dag.py, covering:False) →DeltaTriggerTimetablecreate_delta_data_intervals=True→DeltaDataIntervalTimetablecreate_cron_data_intervals=Truealone → stillDeltaTriggerTimetable(regression guard against the exact bug fixed here)
Confirmed the new test fails against the old code and passes against the fix.
Full
test_dag.pysuite (94 tests) still passes.Note:
unit_tests.cfgsets bothcreate_cron_data_intervalsandcreate_delta_data_intervalstotrue, which is why the existing test suitenever caught this — both keys being
trueproduced the same (accidentallycorrect) result before and after this fix for any test not overriding them
individually.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments.