Complete the code to define a simple Airflow DAG with a start date.
from airflow import DAG from datetime import datetime dag = DAG('example_dag', start_date=[1])
The start_date in Airflow DAGs must be a fixed datetime object, not a dynamic call like datetime.now().
Complete the code to import the operator needed to run a Bash command in Airflow.
from airflow.operators.[1] import BashOperator
The BashOperator is imported from airflow.operators.bash to run bash commands.
Fix the error in the DAG definition by completing the missing argument for the BashOperator.
task1 = BashOperator(task_id='print_date', bash_command=[1], dag=dag)
The bash_command argument must be a string with the command to run, like 'date'.
Fill both blanks to set task dependencies so task1 runs before task2.
task1 [1] task2 task1.[2]
Using task1 >> task2 or task1.set_downstream(task2) sets task1 to run before task2.
Fill all three blanks to create a dictionary comprehension that filters tasks with priority > 5.
high_priority_tasks = {task_id: priority for task_id, priority in tasks.items() if priority [1] [2]
print(high_priority_tasks.get([3], 'Not found'))The comprehension filters tasks with priority greater than 5, then prints the priority of 'task_1' or 'Not found' if missing.