BranchDateTimeOperator

Apache Airflow

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

View on GitHub

Last Updated: Nov. 27, 2022

Access Instructions

Install the Apache Airflow provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

follow_task_ids_if_trueRequiredtask id or task ids to follow if datetime.datetime.now() falls above target_lower and below target_upper.
follow_task_ids_if_falseRequiredtask id or task ids to follow if datetime.datetime.now() falls below target_lower or above target_upper.
target_lowerRequiredtarget lower bound.
target_upperRequiredtarget upper bound.
use_task_logical_dateIf True, uses task’s logical date to compare with targets. Execution date is useful for backfilling. If False, uses system’s date.

Documentation

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 below target_upper and above target_lower.

Was this page helpful?