airflow.timetables.interval
Attributes
Classes
Timetable that schedules data intervals with a cron expression. |
|
Timetable that schedules data intervals with a time delta. |
Module Contents
- airflow.timetables.interval.Delta[source]
- class airflow.timetables.interval.CronDataIntervalTimetable(cron, timezone)[source]
Bases:
airflow.timetables._cron.CronMixin,_DataIntervalTimetableTimetable that schedules data intervals with a cron expression.
This corresponds to
schedule=<cron>, where<cron>is either a five/six-segment representation, or one ofcron_presets.The implementation extends on croniter to add timezone awareness. This is because croniter works only with naive timestamps, and cannot consider DST when determining the next/previous time.
Don’t pass
@oncein here; useOnceTimetableinstead.- classmethod deserialize(data)[source]
Deserialize a timetable from data.
This is called when a serialized DAG is deserialized.
datawill be whatever was returned byserializeduring 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
deserializewhen the DAG is deserialized. The default implementation returns an empty dict.
- infer_manual_data_interval(*, run_after)[source]
When a DAG run is manually triggered, infer a data interval for it.
This is used for e.g. manually-triggered runs, where
run_afterwould be when the user triggers the run. The default implementation raisesNotImplementedError.
- class airflow.timetables.interval.DeltaDataIntervalTimetable(delta)[source]
Bases:
airflow.timetables._delta.DeltaMixin,_DataIntervalTimetableTimetable that schedules data intervals with a time delta.
This corresponds to
schedule=<delta>, where<delta>is either adatetime.timedeltaordateutil.relativedelta.relativedeltainstance.- classmethod deserialize(data)[source]
Deserialize a timetable from data.
This is called when a serialized DAG is deserialized.
datawill be whatever was returned byserializeduring 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
deserializewhen the DAG is deserialized. The default implementation returns an empty dict.
- infer_manual_data_interval(run_after)[source]
When a DAG run is manually triggered, infer a data interval for it.
This is used for e.g. manually-triggered runs, where
run_afterwould be when the user triggers the run. The default implementation raisesNotImplementedError.