Complete the code to import the base class for Airflow operators.
from airflow.operators.[1] import BaseOperator
The BaseOperator class is imported from airflow.operators.base. This is the base class for all operators in Airflow.
Complete the code to define a simple PythonOperator task.
task = PythonOperator(task_id='print_hello', python_callable=[1])
The python_callable argument expects a function name without parentheses. Using print_hello passes the function itself.
Fix the error in the DAG definition by completing the missing argument.
dag = DAG('example_dag', [1], schedule_interval='@daily')
args.The default_args parameter is required to pass default arguments to the DAG. It should be a dictionary of arguments.
Fill both blanks to create a BashOperator that runs a simple command.
task = BashOperator(task_id='run_echo', bash_command=[1], dag=[2])
The bash_command should be a string with the shell command. The dag argument should be the DAG object, here named my_dag.
Fill all three blanks to create a dictionary comprehension that filters tasks by owner.
owner_tasks = {task.task_id: task for task in tasks if task.owner [1] [2]The comprehension filters tasks where the owner equals the string 'airflow'.