1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Apache Airflow in Python

Connected

Exercise

EmailOperator and dependencies

Now that you've successfully defined the PythonOperators for your workflow, your manager would like to receive a copy of the parsed JSON file via email when the workflow completes. The previous tasks are still defined and the DAG process_sales_dag is configured. Please note that this task uses the older DAG definition method and is added for you.

Instructions

100 XP
  • Import the class to send emails.
  • Define the Operator and add the appropriate arguments (to, subject, files).
  • Set the task order so the tasks run sequentially (Pull the file, parse the file, then email your manager).