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: May. 7, 2021

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_trueRequiredstr or list[str]task id or task ids to follow if datetime.datetime.now() falls above target_lower and below target_upper.
follow_task_ids_if_falseRequiredstr or list[str]task id or task ids to follow if datetime.datetime.now() falls below target_lower or above target_upper.
target_lowerRequiredOptional[datetime.datetime]target lower bound.
target_upperRequiredOptional[datetime.datetime]target upper bound.
use_task_execution_dateboolIf True, uses task’s execution day 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?