Skip to content

Align Dag Runs docs with Airflow 3 trigger timetable defaults#70167

Open
Tegh25 wants to merge 2 commits into
apache:mainfrom
Tegh25:feature/update_dag-run_trigger_data_interval_doc
Open

Align Dag Runs docs with Airflow 3 trigger timetable defaults#70167
Tegh25 wants to merge 2 commits into
apache:mainfrom
Tegh25:feature/update_dag-run_trigger_data_interval_doc

Conversation

@Tegh25

@Tegh25 Tegh25 commented Jul 21, 2026

Copy link
Copy Markdown

The Data Interval and Catchup sections in dag-run.rst still described @daily and catchup as if CronDataIntervalTimetable were the default. That matches Airflow 2 / create_cron_data_intervals=True, not Airflow 3, where bare cron strings resolve to CronTriggerTimetable by default.

Update the Data Interval section to explain that interval semantics depend on the timetable: trigger timetables use zero-width intervals at the trigger time; data-interval timetables use contiguous windows and schedule after the
window ends. Link to the timetable comparison docs for logical_date and run_id differences.

Update the Catchup section and tutorial example to describe behavior under the Airflow 3 default (CronTriggerTimetable, catchup=False), and keep the prior data-interval story as the explicit opt-in case (CronDataIntervalTimetable or create_cron_data_intervals=True). Use timetable-neutral wording ("scheduled run times") in the catchup intro so it
applies to both timetable kinds.

No newsfragment: documentation-only clarification aligned with existing authoring-and-scheduling/timetable.rst content.


Was generative AI tooling used to co-author this PR?
  • Yes — Cursor (Auto)

Generated-by: Cursor (Auto) following the guidelines


  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@Tegh25

Tegh25 commented Jul 21, 2026

Copy link
Copy Markdown
Author

Tagging @ferruzzi for visibility

Comment on lines +154 to +158
:ref:`CronTriggerTimetable` for ``@daily`` and ``catchup=False``, the scheduler
does **not** create a run for the past midnight. The next Dag run is created at
midnight on the morning of 2016-01-03, with ``data_interval_start`` and
``data_interval_end`` both equal to that trigger time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this one? Based on my understanding and what is already said above, I would expect the previous midnight to get run.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When writing this section, I was referencing this example on the timetable doc.

For example, suppose there is a cron expression @daily or 0 0 * * *, which is scheduled to run at 12AM every day. If you enable Dags using the two timetables at 3PM on January 31st, CronTriggerTimetable creates a new Dag run at 12AM on February 1st. The run_id timestamp is midnight, on February 1st.

In this case after enablement, the next Dag run is created on the following midnight, not the previous one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something isn't adding up. If you check out the unit test test_daily_cron_trigger_no_catchup_first_starts_at_next_schedule (specifically the first-run case) here it seems to be testing this and asserting the opposite. Any chance you are using out of date docs to update out of date docs? LOL Have a look at the test, maybe I'm just mis-reading it.

of a Dag run, for example, denotes the start of the data interval, not when the
Dag is actually executed.
of a Dag run is defined by the timetable: for a trigger timetable it is the
trigger time; for a data-interval timetable it is the start of the data

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only true for zero-width intervals, otherwise it's trigger_time-interval, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean. You're referring to CronTriggerTimetable or DeltaTriggerTimetable with a non-zero interval= argument, right?

You're right: DagRunInfo.logical_date is always data_interval.start. For the default zero-width case (interval=timedelta()), that equals the trigger time. With a non-zero interval, the run still fires at the cron tick T, but the data interval is [T - interval, T], so logical_date is T - interval (i.e. data_interval_start), not T.

I can adjust that sentence so it doesn't exclude the non-default case.
e.g. that for a trigger timetable logical_date is data_interval_start, which equals the trigger time when the interval is zero-width (the default).

scheduled one interval after ``start_date``.
the same logical date, it marks the start of scheduling for the Dag (the first
possible logical date), not when tasks in the Dag will start running. In other
words, a Dag run will only be scheduled once the timetable advances past

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nipick, it looks like it's a >=, so "reaches" might be technically more accurate than "advances past"?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I can make the change to "reaches".

@Tegh25 Tegh25 changed the title Docs: Align Dag Runs docs with Airflow 3 trigger timetable defaults Align Dag Runs docs with Airflow 3 trigger timetable defaults Jul 21, 2026
Prior version assumed that all trigger timetable dags had a zero-width
interval, which is not true.
Also adjusted "advances past" to "reaches" for more correctness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants