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 default arguments for the DAG.
default_args = {
'owner': 'airflow',
'start_date': [1]
}Using a fixed start_date like datetime(2023, 1, 1) ensures consistent DAG runs and avoids unexpected behavior.
Fix the error in the task definition by completing the operator name.
task1 = [1]( task_id='print_date', dag=dag )
BashOperator runs bash commands, which fits a task named 'print_date'.
Fill both blanks to create a dictionary comprehension that filters tasks with retries greater than 1.
filtered_tasks = {task.task_id: task for task in tasks if task.[1] [2] 1}This comprehension selects tasks where retries is greater than 1, helping identify tasks needing attention.
Fill all three blanks to create a dictionary of task_ids and owners for tasks that are active.
active_tasks = {task.[1]: task.[2] for task in tasks if task.[3] == True}This comprehension collects task IDs and owners only for tasks marked as active, helping manage workflow ownership.