1. Learn
  2. /
  3. Courses
  4. /
  5. Python으로 배우는 Apache Airflow 입문

Connected

Exercise

Implementing a callback function

You've recently been assigned to add failure callbacks to the Dags created by your team. To start, you'd like to add a simple failure callback that writes a message to the audit log when the sales_etl_dag fails.

The dag and task objects are already imported and the get_sales_data and process_sales_data tasks have been created.

Instructions

100 XP
  • Create a callback function named alert_on_failure.
  • Define the function to accept any objects Airflow passes to it.
  • Specify a failure callback using the alert_on_failure function.