sharetheknowledge opened a new pull request, #69869:
URL: https://github.com/apache/airflow/pull/69869
Fixes a bug where `create_delta_data_intervals` had no effect on DAGs with a
`timedelta`/`relativedelta` schedule.
`_create_timetable()` in `task-sdk/src/airflow/sdk/definitions/dag.py`
checked
`create_cron_data_intervals` for **both** the cron-string branch and the
`timedelta`/`relativedelta` branch. As a result:
- `create_delta_data_intervals` had no effect at all — it's referenced
nowhere
else in the codebase besides CLI config-list metadata and docs.
- `create_cron_data_intervals` silently controlled timetable selection for
`timedelta`/`relativedelta` schedules too, which isn't what it's documented
to do (`config.yml` describes it as governing only cron-string schedules).
The `timedelta | relativedelta` branch now checks
`create_delta_data_intervals`
instead, matching `config.yml`'s documented behavior and making the two
config
keys independent, as intended.
Added `test_timedelta_schedule_respects_create_delta_data_intervals_config`
in
`task-sdk/tests/task_sdk/definitions/test_dag.py`, covering:
- default (both `False`) → `DeltaTriggerTimetable`
- `create_delta_data_intervals=True` → `DeltaDataIntervalTimetable`
- `create_cron_data_intervals=True` alone → still `DeltaTriggerTimetable`
(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.py` suite (94 tests) still passes.
Note: `unit_tests.cfg` sets both `create_cron_data_intervals` and
`create_delta_data_intervals` to `true`, which is why the existing test suite
never caught this — both keys being `true` produced the same (accidentally
correct) result before and after this fix for any test not overriding them
individually.
* closes: #69868
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment:
`{pr_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]