Fix create_delta_data_intervals being ignored for timedelta schedules - #69869
Open
sharetheknowledge wants to merge 11 commits into
Open
Fix create_delta_data_intervals being ignored for timedelta schedules#69869sharetheknowledge wants to merge 11 commits into
sharetheknowledge wants to merge 11 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
sharetheknowledge
requested review from
amoghrajesh,
ashb and
kaxil
as code owners
July 14, 2026 11:55
|
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
|
1 task
kaxil
reviewed
Aug 3, 2026
Per kaxil review: sibling files (test_connection.py, test_variables.py, test_operator_resources.py) all import conf_vars at module level. No circular-import reason for it to live in the function body.
Per kaxil review: convert the three inline conf_vars blocks to a single @pytest.mark.parametrize test. Stack a schedule parametrize to also cover relativedelta, giving 6 test cases (3 config combos x timedelta/relativedelta). Hoist DeltaDataIntervalTimetable, DeltaTriggerTimetable, and relativedelta to module level (required for parametrize decorator to reference them).
ruff check --select I flagged I001. Sort pytest before dateutil in the third-party block, and definitions.param before definitions.timetables.* in the first-party block.
The new create_delta_data_intervals bullet makes three items in the list, but the lead-in sentence still said two.
Author
|
All three review comments are addressed:
|
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.
Tests
test_timedelta_schedule_respects_create_delta_data_intervals_configintask-sdk/tests/task_sdk/definitions/test_dag.pyis parametrized over(delta, cron, expected)and over the schedule type:False(the shipped default) ->DeltaTriggerTimetablecreate_delta_data_intervals=True->DeltaDataIntervalTimetablecreate_cron_data_intervals=Truealone -> stillDeltaTriggerTimetable(regression guard against the exact bug fixed here)
each run against
timedelta(days=1)andrelativedelta(days=1), for sixindependent cases.
Verified locally: all six pass against the fix, and four of the six fail
against the pre-fix code (both
delta-truerows and bothcron-truerows,including the
relativedeltaones). Fulltest_dag.pysuite: 99 passed.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.
Docs and newsfragment
The fix changes behavior for anyone who set
create_cron_data_intervals = Trueon the upgrade guide's advice, so this PR documents it in four places:
airflow-core/newsfragments/69869.significant.rst- who is affected and theremedy.
upgrading_to_airflow3.rst- a bullet next to the existingcreate_cron_data_intervalsone.timetable.rst-create_delta_data_intervalsadded to "Switching betweentrigger and data interval timetables".
config.yml- the skip-one-period paragraph the cron entry already had butthe delta entry lacked.
Setting
create_delta_data_intervals = Trueis a no-op before this fix, so itcan be set ahead of upgrading to keep current behavior.
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.