Exercise

Using the PythonOperator

You've implemented several Airflow tasks using the BashOperator but realize that a couple of specific tasks would be better implemented using Python. You'll implement a task to download and save a file to the system within Airflow.

The requests library is imported for you, and the DAG process_sales_dag is already defined.

Instructions 1/3

undefined XP
    1
    2
    3
  • Define a function called pull_file with two parameters, URL and savepath.
  • Use the print() function and Python f-strings to write a message to the logs.