Posts

Showing posts with the label Depends On Past

Manage flow of tasks - Airflow Tutorial Trigger Rules, Conditional Branching, Setup Teardown, Latest Only, Depends On Past

  Hello Data Pros, and welcome back to another exciting episode of our Apache Airflow series! ****  Code lines at the End  **** Today, we'll explore how to manage the flow of tasks in Airflow—a critical step in orchestrating efficient data pipelines !   With the default airflow settings, a task is executed only when all its dependencies complete successfully. However, in real-world projects, customizing this default behaviour becomes essential to address a vast number of use cases.   For example, you might need to dynamically pick and run a specific branch depending on the outcome of a preceding task, while skipping the remaining branches. The Branch Python Operator facilitates this feature, by allowing you to select a branch through a user-defined Python function. Within this function, you can implement the logic to determine the appropriate branch, and should ensure that it returns the task ID of the downstream task to be executed next.   All the code lin...