Complete the code to view the latest logs of a task instance in Airflow CLI.
airflow tasks [1] my_dag my_task 2023-06-01
The airflow tasks logs command shows logs for a specific task instance.
Complete the code to check the status of all tasks in a DAG run using Airflow CLI.
airflow tasks [1] my_dag 2023-06-01
The airflow tasks list command shows all tasks and their status for a DAG run.
Fix the error in the command to clear task instances for a DAG run.
airflow tasks [1] my_dag my_task 2023-06-01 --yes
The correct subcommand to clear task instances is clear.
Fill both blanks to create a dictionary comprehension that filters logs by task state.
filtered_logs = {task_id: log for task_id, log in logs.items() if task_states[task_id] [1] [2]This comprehension keeps logs where the task state equals 'success'.
Fill all three blanks to create a dictionary comprehension that maps task IDs to logs for failed tasks.
failed_logs = { [1]: [2] for [3], [2] in logs.items() if task_states[[1]] == 'failed' }This comprehension creates a dictionary of logs for tasks that failed, using task IDs as keys.