From 87ba80e77c7eba9e12e8f738574400c357310223 Mon Sep 17 00:00:00 2001 From: raphaelauv Date: Sat, 25 Jul 2026 04:26:10 +0200 Subject: [PATCH] real example of CronDataIntervalTimetable and DeltaDataIntervalTimetable (#70303) * documentation - real example of CronDataIntervalTimetable and DeltaDataIntervalTimetable * review 1 --------- Co-authored-by: raphaelauv --- .../authoring-and-scheduling/timetable.rst | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/airflow-core/docs/authoring-and-scheduling/timetable.rst b/airflow-core/docs/authoring-and-scheduling/timetable.rst index b19cc80211392..8724330057efb 100644 --- a/airflow-core/docs/authoring-and-scheduling/timetable.rst +++ b/airflow-core/docs/authoring-and-scheduling/timetable.rst @@ -197,7 +197,7 @@ DeltaDataIntervalTimetable ^^^^^^^^^^^^^^^^^^^^^^^^^^ A timetable that schedules data intervals with a time delta. You can select it by providing a -:class:`datetime.timedelta` or ``dateutil.relativedelta.relativedelta`` to the ``schedule`` parameter of a Dag. +:class:`DeltaDataIntervalTimetable` to the ``schedule`` parameter of a Dag. This timetable focuses on the data interval value and does not necessarily align execution dates with arbitrary bounds, such as the start of day or of hour. @@ -206,7 +206,12 @@ arbitrary bounds, such as the start of day or of hour. .. code-block:: python - @dag(schedule=datetime.timedelta(minutes=30)) + from datetime import timedelta + + from airflow.sdk import dag, DeltaDataIntervalTimetable + + + @dag(schedule=DeltaDataIntervalTimetable(timedelta(minutes=30))) def example_dag(): pass @@ -216,17 +221,18 @@ CronDataIntervalTimetable ^^^^^^^^^^^^^^^^^^^^^^^^^ A timetable that accepts a cron expression, creates data intervals according to the interval between each cron -trigger points, and triggers a Dag run at the end of each data interval. +trigger points, and triggers a Dag run at the end of each data interval. You can select it by providing a +:class:`CronDataIntervalTimetable` to the ``schedule`` parameter of a Dag. .. seealso:: `Differences between "trigger" and "data interval" timetables`_ .. seealso:: `Differences between the cron and delta data interval timetables`_ -Select this timetable by providing a valid cron expression as a string to the ``schedule`` -parameter of a Dag, as described in the :doc:`../core-concepts/dags` documentation. - .. code-block:: python - @dag(schedule="0 1 * * 3") # At 01:00 on Wednesday. + from airflow.sdk import dag, CronDataIntervalTimetable + + + @dag(schedule=CronDataIntervalTimetable("0 1 * * 3")) # At 01:00 on Wednesday. def example_dag(): pass