A. The PythonOperator is missing retries parameter
B. The task_id is invalid and causes failure
C. The condition is reversed; it raises error when schema is valid
D. The function does not return any value
Solution
Step 1: Analyze the condition logic
The function raises error if schema_is_valid() is True, which is wrong.
Step 2: Identify correct logic for schema validation
Error should raise when schema_is_valid() is False, indicating mismatch.
Final Answer:
The condition is reversed; it raises error when schema is valid -> Option C
Quick Check:
Raise error on invalid schema, not valid = B [OK]
Hint: Check if condition logic matches error raising intent [OK]
Common Mistakes:
Reversing condition logic
Ignoring task_id naming rules
Expecting return value in PythonOperator callable
5. You want to handle schema changes gracefully in Airflow by branching: if schema matches, continue processing; if not, send alert and stop. Which Airflow feature helps implement this logic?
hard
A. LatestOnlyOperator to run tasks only on latest DAG run
B. SubDagOperator to run schema check in a sub-DAG
C. TriggerDagRunOperator to start a new DAG on schema mismatch
D. BranchPythonOperator to choose next task based on schema check
Solution
Step 1: Understand branching in Airflow
BranchPythonOperator allows choosing next task based on condition.
Step 2: Match branching to schema check use case
Use BranchPythonOperator to continue or alert based on schema validity.
Final Answer:
BranchPythonOperator to choose next task based on schema check -> Option D
Quick Check:
Branching logic = BranchPythonOperator = A [OK]
Hint: Use BranchPythonOperator for conditional task flow [OK]
Common Mistakes:
Using SubDagOperator which is for nested DAGs
TriggerDagRunOperator starts new DAG, not branching
LatestOnlyOperator controls run timing, not branching
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.