Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions airflow-core/docs/authoring-and-scheduling/timetable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand All @@ -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.
Comment thread
raphaelauv marked this conversation as resolved.
def example_dag():
pass

Expand Down