Complete the code to import the Airflow DAG class.
from airflow.[1] import DAG
The DAG class is imported from airflow.models to define workflows.
Complete the code to set the DAG's start date using datetime.
from datetime import datetime start_date = datetime([1])
The start_date defines when the DAG begins scheduling. Using 2024, 1, 1 sets it to January 1, 2024.
Fix the error in the task definition by completing the operator import.
from airflow.operators.[1] import BashOperator
BashOperator is imported from airflow.operators.bash to run bash commands in tasks.
Fill both blanks to create a task that runs a bash command and assign it to the DAG.
task1 = BashOperator(task_id='print_date', bash_command=[1], dag=[2])
The bash_command should be 'date' to print the date, and the dag parameter should be the DAG object, here named my_dag.
Fill all three blanks to create a dictionary comprehension that filters tasks with retries greater than 0.
filtered_tasks = {task.task_id: task for task in tasks if task.retries [1] [2] and task.owner == [3]This comprehension selects tasks where retries are greater than 0 and the owner is 'airflow'.