1. 학습
  2. /
  3. 강의
  4. /
  5. Python으로 배우는 Apache Airflow 입문

Connected

연습 문제

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.

지침

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.