airflow.operators.datetime
¶
Module Contents¶
Classes¶
Branches into one of two lists of tasks depending on the current datetime. |
Functions¶
|
Ensures upper and lower time targets are datetimes by combining them with base_date |
- class airflow.operators.datetime.BranchDateTimeOperator(*, follow_task_ids_if_true, follow_task_ids_if_false, target_lower, target_upper, use_task_execution_date=False, **kwargs)[source]¶
Bases:
airflow.operators.branch.BaseBranchOperator
Branches into one of two lists of tasks depending on the current datetime. For more information on how to use this operator, take a look at the guide: BranchDateTimeOperator
True branch will be returned when
datetime.datetime.now()
falls belowtarget_upper
and abovetarget_lower
.- Parameters
follow_task_ids_if_true (Union[str, Iterable[str]]) -- task id or task ids to follow if
datetime.datetime.now()
falls above target_lower and belowtarget_upper
.follow_task_ids_if_false (Union[str, Iterable[str]]) -- task id or task ids to follow if
datetime.datetime.now()
falls below target_lower or abovetarget_upper
.target_lower (Union[datetime.datetime, datetime.time, None]) -- target lower bound.
target_upper (Union[datetime.datetime, datetime.time, None]) -- target upper bound.
use_task_execution_date (bool) -- If
True
, uses task's execution day to compare with targets. Execution date is useful for backfilling. IfFalse
, uses system's date.