Complete the code to import the DAG class from Airflow.
from airflow.[1] import DAG
The DAG class is imported from the models module in Airflow.
Complete the code to set the schedule interval for a DAG to run daily.
dag = DAG('example_dag', schedule_interval=[1])
The schedule_interval set to '@daily' makes the DAG run once every day.
Fix the error in the task definition by completing the operator import.
from airflow.operators.[1] import BashOperator
The BashOperator is imported from the bash module inside operators.
Fill both blanks to create a task that runs a bash command in the DAG.
task1 = [1](task_id='print_date', bash_command=[2], dag=dag)
The task uses BashOperator and runs the 'date' command.
Fill all three blanks to define a DAG with default args and a Python task.
from datetime import datetime default_args = {'owner': [1], 'start_date': [2] dag = DAG('my_dag', default_args=default_args, schedule_interval='@daily') def my_task(): print('Hello Airflow') task = [3](task_id='print_hello', python_callable=my_task, dag=dag)
The owner is a string, the start_date is a datetime object, and the task uses PythonOperator to run Python code.
