create_delta_data_intervals is never read - timedelta/relativedelta schedules check create_cron_data_intervals instead
- Dominant language
- Python
- Stars
- 46.9k
- Forks
- 17.8k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 472
Description
### Under which category would you file this issue?
Task SDK
### Apache Airflow version
3.3.0 (bug confirmed present via source review; also reproduced hands-on on 3.2.2, and confirmed present on `main` as of 2026-07-14)
### What happened and how to reproduce it?
`airflow.cfg`'s `[scheduler] create_delta_data_intervals` setting is never read anywhere in the codebase - it has no effect. Meanwhile `[scheduler] create_cron_data_intervals` silently controls timetable selection for **both** cron-string schedules (documented) **and** `timedelta`/`relativedelta` schedules (undocumented, and contradicts `config.yml`'s own description of what `create_delta_data_intervals` is supposed to do).
Root cause is in `_create_timetable()` in `task-sdk/src/airflow/sdk/definitions/dag.py` (lines 148–169 on `main` / 3.3.0):
```python
if isinstance(interval, timedelta | relativedelta):
if airflow_conf.getboolean("scheduler", "create_cron_data_intervals"): # <-- should be create_delta_data_intervals
return DeltaDataIntervalTimetable(interval)
return DeltaTriggerTimetable(interval)
if isinstance(interval, str):
if airflow_conf.getboolean("scheduler", "create_cron_data_intervals"):
return CronDataIntervalTimetable(interval, timezone)
return CronTriggerTimetable(interval, timezone=timezone)
```
Both branches check the same config key, `create_cron_data_intervals`. The `timedelta`/`relativedelta` branch should check `create_delta_data_intervals` instead, per `config.yml`'s own description of that setting (`airflow-core/src/airflow/config_templates/config.yml`, `create_delta_data_intervals` entry).
**Steps to reproduce**
1. Use any DAG scheduled with a plain `timedelta`, e.g. the stock `tutorial` DAG:
```python
schedule=timedelta(days=1)
```
2. In `airflow.cfg`, set:
```
[scheduler]
create_delta_data_intervals = True
```
3. Confirm the config is actually being read:
```python
from airflow.configuration import conf
print(conf.getboolean("scheduler", "create_delta_data_intervals")) # prints True
```
4. Load the DAG and inspect its timetable:
```python
from airflow.models import DagBag
dag = DagBag().get_dag("tutorial")
print(type(dag.timetable))
```
**Result:** still `DeltaTriggerTimetable` - `create_delta_data_intervals=True` had no effect.
5. Now instead set `create_cron_data_intervals = True` (leaving `create_delta_data_intervals` at its default) and rerun step 4.
**Result:** `dag.timetable` becomes `DeltaDataIntervalTimetable`, even though the DAG's schedule is a `timedelta`, not a cron string - proving the wrong config key is being consulted.
### What you think should happen instead?
The `timedelta | relativedelta` branch of `_create_timetable()` should check `create_delta_data_intervals`, matching what `config.yml` documents for that setting and keeping it independent from `create_cron_data_intervals` (which should only affect the `str`/cron branch). The fix is a one-line change:
```python
if isinstance(interval, timedelta | relativedelta):
if airflow_conf.getboolean("scheduler", "create_delta_data_intervals"):
return DeltaDataIntervalTimetable(interval)
return DeltaTriggerTimetable(interval)
```
### Operating System
Windows 11 / WSL2 (Ubuntu), reproduced via a local virtualenv install
### Deployment
Virtualenv installation
### Apache Airflow Provider(s)
_No response_
### Versions of Apache Airflow Providers
N/A
### Official Helm Chart version
Not Applicable
### Kubernetes Version
_No response_
### Helm Chart configuration
_No response_
### Docker Image customizations
_No response_
### Anything else?
Confirmed by reading source directly (not just local install):
- Installed venv (Airflow 3.2.2): `venv/lib/python3.12/site-packages/airflow/sdk/definitions/dag.py`
- `github.com/apache/airflow` tag `3.2.2`: same code
- `github.com/apache/airflow` tag `3.3.0`: same code, lines 148–169
- `github.com/apache/airflow` branch `main`: same code, unchanged
Also confirmed `create_delta_data_intervals` is referenced nowhere else in the codebase except:
- `airflow-core/src/airflow/cli/commands/config_command.py` (CLI config-list metadata only)
- `config_templates/config.yml` (docs only)
- `config_templates/unit_tests.cfg` (sets it `true` for test fixtures, but no code path reads it for this purpose)
This makes `create_delta_data_intervals` fully dead config as of at least 3.2.2 through `main`.
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
Start in task-sdk/src/airflow/sdk/definitions/dag.py at _create_timetable() and compare the timedelta/relativedelta branch with the create_delta_data_intervals entry in airflow-core/src/airflow/config_templates/config.yml. Reproduce the behavior using the issue's configuration steps and inspect the timetable type; done means the delta setting controls delta schedules independently of create_cron_data_intervals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100