0
0
Apache Airflowdevops~5 mins

Task dependencies (>> and << operators) in Apache Airflow - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the >> operator do in Airflow task dependencies?
The >> operator sets a downstream dependency, meaning the task on the left must run before the task on the right.
Click to reveal answer
beginner
How does the << operator work in Airflow task dependencies?
The << operator sets an upstream dependency, meaning the task on the right must run before the task on the left.
Click to reveal answer
beginner
How would you express that task A runs before tasks B and C using >> operator?
You write: A >> [B, C]. This means task A runs first, then tasks B and C run after.
Click to reveal answer
beginner
Can you chain multiple tasks using >> operator? Example?
Yes. For example, A >> B >> C means A runs first, then B, then C in order.
Click to reveal answer
intermediate
What happens if you mix >> and << operators in the same dependency chain?
They represent the same dependencies but from different directions. For example, A >> B is the same as B << A.
Click to reveal answer
In Airflow, what does the expression 'task1 >> task2' mean?
Atask1 runs before task2
Btask2 runs before task1
Ctask1 and task2 run at the same time
Dtask1 depends on task2 to finish
Which operator sets an upstream dependency in Airflow?
A==
B>>
C<<
D!=
How do you specify that task A runs before tasks B and C?
AA << [B, C]
B[B, C] >> A
C[B, C] << A
DA >> [B, C]
What does 'A >> B >> C' mean in Airflow?
AC runs, then B runs, then A runs
BA runs, then B runs, then C runs
CA, B, and C run simultaneously
DB depends on A and C
Is 'A >> B' equivalent to 'B << A' in Airflow?
AYes, both mean A runs before B
BNo, they mean opposite things
COnly if tasks are in the same DAG
DOnly if tasks are different types
Explain how to use the >> and << operators to set task dependencies in Airflow.
Think about which task runs first and which runs after.
You got /4 concepts.
    Describe how to express multiple downstream tasks from a single upstream task using Airflow operators.
    Use square brackets to group tasks.
    You got /3 concepts.