taskairflowschedulingdirected-acyclic-graphsconcept

how set airflow DAG Concept scheduling


I'm trying some airflow DAG Schedule.

I scheduled like below code.

Task1 >> [Task2, Task3] >> Task4

Then, i expected running Task4 once, when finished task2 and task3.

but.. i think... task4 ran twice.

(task1 -> task2 -> task4) and (task1 -> task3 -> task4)

reason is.. i saw airflow DAG tree view.

print_data1" is task4

How to set running task4 only once?


Solution

  • The Tree View in the Airflow UI shows all distinct branches from root to leaf in the DAG. Based on the screenshot you provided, there are 2 branches:

    This does not mean that the print_date_1 task ran twice. To see the actual DAG check out the Graph View (just to the right of the Tree View button). You should see that each task is present only once.

    You may find this guide helpful to understand the Airflow UI.