This is an automated email from the ASF dual-hosted git repository.
uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new b448e6ec582 Clarify when last_automated_data_interval is None in
timetable docs (#68461)
b448e6ec582 is described below
commit b448e6ec58276f07fff50c170cba429aed492446
Author: Vedant Agarwal <[email protected]>
AuthorDate: Thu Jul 2 06:26:26 2026 +0800
Clarify when last_automated_data_interval is None in timetable docs (#68461)
---
airflow-core/docs/howto/timetable.rst | 9 +++++++++
airflow-core/src/airflow/timetables/base.py | 3 +++
2 files changed, 12 insertions(+)
diff --git a/airflow-core/docs/howto/timetable.rst
b/airflow-core/docs/howto/timetable.rst
index b5c1aeadb40..90308ca42e5 100644
--- a/airflow-core/docs/howto/timetable.rst
+++ b/airflow-core/docs/howto/timetable.rst
@@ -144,6 +144,15 @@ how the Dag and its tasks specify the schedule, and
contains three attributes:
(the *start* of the data interval), not when the run will be scheduled
(usually after the end of the data interval).
+.. note::
+
+ ``last_automated_data_interval`` is only ever ``None`` when the Dag is
+ first picked up by the Dag processor: the first run is calculated at
+ parsing time, before any Dag run exists, and the result is stored on the
+ Dag. During scheduling, ``next_dagrun_info`` is always called with the
+ previous run's data interval already populated, so the ``None`` case does
+ not appear in scheduler logs when a Dag is unpaused for the first time.
+
If there was a run scheduled previously, we should now schedule for the next
non-holiday weekday by looping through subsequent days to find one that is not
a Saturday, Sunday, or US holiday. If there was not a previous scheduled run,
diff --git a/airflow-core/src/airflow/timetables/base.py
b/airflow-core/src/airflow/timetables/base.py
index 84d8aa2e46f..365f980b932 100644
--- a/airflow-core/src/airflow/timetables/base.py
+++ b/airflow-core/src/airflow/timetables/base.py
@@ -444,6 +444,9 @@ class Timetable(Protocol):
:param last_automated_data_interval: The data interval of the
associated
DAG's last scheduled or backfilled run (manual runs not
considered).
+ This is only ``None`` when the Dag is being scheduled for the first
+ time, which happens when the Dag processor first parses the Dag --
+ before any Dag run exists.
:param restriction: Restriction to apply when scheduling the DAG run.
See documentation of :class:`TimeRestriction` for details.