A. SMTP server is not configured in Airflow settings
B. The 'to' parameter must be a string, not a list
C. Missing 'from_email' parameter in EmailOperator
D. The 'subject' parameter cannot contain spaces
Solution
Step 1: Check EmailOperator parameters
The 'to' parameter accepts a list, and 'subject' with spaces is valid.
Step 2: Identify common failure cause
EmailOperator requires SMTP server setup in Airflow config; missing this causes failure.
Final Answer:
SMTP server is not configured in Airflow settings -> Option A
Quick Check:
SMTP setup missing = failure [OK]
Hint: Check SMTP config if EmailOperator fails [OK]
Common Mistakes:
Assuming 'to' cannot be a list
Thinking the 'subject' parameter cannot contain spaces
Thinking 'from_email' is mandatory parameter
5. You want to send an email notification only when a task fails using EmailOperator. Which Airflow feature should you use to trigger the email task only on failure?
hard
A. Set trigger_rule="one_failed" on the EmailOperator task
B. Set trigger_rule="all_success" on the EmailOperator task
C. Use depends_on_past=True on the EmailOperator task
D. Set email_on_failure=False in the DAG definition
Solution
Step 1: Understand trigger_rule usage
Setting trigger_rule="one_failed" makes the task run only if any upstream task fails.
Step 2: Evaluate other options
all_success runs only if all succeed; depends_on_past controls task dependency on previous runs; email_on_failure is a DAG-level flag, not for task trigger.
Final Answer:
Set trigger_rule="one_failed" on the EmailOperator task -> Option A
Quick Check:
Trigger on failure = trigger_rule one_failed [OK]
Hint: Use trigger_rule='one_failed' to run on failure only [OK]
Common Mistakes:
Using trigger_rule='all_success' for failure notification
Confusing depends_on_past with failure triggers
Misusing email_on_failure flag for task triggers
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.