Recall & Review
beginner
What is a task failure callback in Airflow?
A task failure callback is a function that runs automatically when a task fails. It helps you respond to failures, like sending alerts or cleaning up resources.
Click to reveal answer
beginner
How do you define a task failure callback in an Airflow DAG?
You define a Python function and assign it to the task's
on_failure_callback parameter. This function receives context about the failed task.Click to reveal answer
intermediate
What kind of information can you access inside a task failure callback function?
You can access the task instance, execution date, exception details, and other context data to understand why the task failed.
Click to reveal answer
intermediate
Why use task failure callbacks instead of just checking logs?
Callbacks let you automate responses like sending emails or notifications immediately after failure, saving time and reducing manual checks.Click to reveal answer
beginner
Can you use the same failure callback for multiple tasks?
Yes, you can reuse the same failure callback function for many tasks to keep your code simple and consistent.
Click to reveal answer
What parameter do you use to set a failure callback on an Airflow task?
✗ Incorrect
The
on_failure_callback parameter is used to specify a function that runs when a task fails.What does the failure callback function receive as input?
✗ Incorrect
The failure callback function receives a context dictionary with details about the task and failure.
Which of these is a common use for task failure callbacks?
✗ Incorrect
Sending alert emails is a common way to respond immediately to task failures.
Can a failure callback stop the task from failing?
✗ Incorrect
Failure callbacks run after the task has failed; they do not prevent failure.
Is it possible to share one failure callback function across multiple tasks?
✗ Incorrect
You can reuse the same failure callback function for many tasks to keep code simple.
Explain how to create and use a task failure callback in Airflow.
Think about what happens when a task fails and how you can respond automatically.
You got /4 concepts.
Describe why task failure callbacks are useful in managing Airflow workflows.
Consider how you handle problems in daily tasks and how automation helps.
You got /4 concepts.