Given the following Airflow task dependencies:
task1 >> task2 >> task3
Which statement best describes the execution order of these tasks?
The >> operator sets the order from left to right.
The >> operator in Airflow sets a downstream dependency. So task1 runs before task2, and task2 runs before task3.
Consider the following Airflow task dependencies:
task3 << task2 << task1
What is the correct execution order of the tasks?
The << operator sets upstream dependencies.
The << operator means the task on the right runs before the task on the left. So task1 runs before task2, and task2 runs before task3.
You want to create a DAG where task1 runs first, then task2 and task3 run in parallel, and finally task4 runs after both task2 and task3 complete.
Which code snippet correctly sets these dependencies using >> and/or << operators?
Use >> to set downstream dependencies and list to set parallel tasks.
Using task1 >> [task2, task3] >> task4 means task1 runs first, then task2 and task3 run in parallel, then task4 runs after both finish.
Given the following dependencies:
task1 >> task2 task2 >> task3 task3 >> task1
What error will Airflow raise when parsing this DAG?
Check if the dependencies form a loop.
The dependencies form a cycle: task1 -> task2 -> task3 -> task1, which Airflow does not allow and raises a cycle exception.
You have tasks start, middle1, middle2, and end. You want start to run first, then middle1 and middle2 in parallel, and finally end after both middles finish.
Which of the following is the clearest and most maintainable way to set these dependencies using >> and/or << operators?
Consider readability and explicitness for future maintenance.
Option B explicitly sets each dependency on its own line, making it clear and easy to maintain. Option B is concise but less explicit. Option B and D do not represent the correct order clearly.