airflow.timetables.trigger¶
Classes¶
Timetable that triggers DAG runs according to a cron expression. |
|
Timetable that triggers DAG runs according to a cron expression. |
Module Contents¶
- class airflow.timetables.trigger.DeltaTriggerTimetable(delta, *, interval=datetime.timedelta())[source]¶
Bases:
airflow.timetables._delta.DeltaMixin
,_TriggerTimetable
Timetable that triggers DAG runs according to a cron expression.
This is different from
DeltaDataIntervalTimetable
, where the delta value specifies the data interval of a DAG run. With this timetable, the data intervals are specified independently. Also for the same reason, this timetable kicks off a DAG run immediately at the start of the period, instead of needing to wait for one data interval to pass.- Parameters:
delta (datetime.timedelta | dateutil.relativedelta.relativedelta) – How much time to wait between each run.
interval (datetime.timedelta | dateutil.relativedelta.relativedelta) – The data interval of each run. Default is 0.
- classmethod deserialize(data)[source]¶
Deserialize a timetable from data.
This is called when a serialized DAG is deserialized.
data
will be whatever was returned byserialize
during DAG serialization. The default implementation constructs the timetable without any arguments.
- serialize()[source]¶
Serialize the timetable for JSON encoding.
This is called during DAG serialization to store timetable information in the database. This should return a JSON-serializable dict that will be fed into
deserialize
when the DAG is deserialized. The default implementation returns an empty dict.
- class airflow.timetables.trigger.CronTriggerTimetable(cron, *, timezone, interval=datetime.timedelta())[source]¶
Bases:
airflow.timetables._cron.CronMixin
,_TriggerTimetable
Timetable that triggers DAG runs according to a cron expression.
This is different from
CronDataIntervalTimetable
, where the cron expression specifies the data interval of a DAG run. With this timetable, the data intervals are specified independently from the cron expression. Also for the same reason, this timetable kicks off a DAG run immediately at the start of the period (similar to POSIX cron), instead of needing to wait for one data interval to pass.Don’t pass
@once
in here; useOnceTimetable
instead.- classmethod deserialize(data)[source]¶
Deserialize a timetable from data.
This is called when a serialized DAG is deserialized.
data
will be whatever was returned byserialize
during DAG serialization. The default implementation constructs the timetable without any arguments.
- serialize()[source]¶
Serialize the timetable for JSON encoding.
This is called during DAG serialization to store timetable information in the database. This should return a JSON-serializable dict that will be fed into
deserialize
when the DAG is deserialized. The default implementation returns an empty dict.