0
0
Apache Airflowdevops~5 mins

Debugging with Airflow CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the Airflow CLI command airflow tasks test?
It runs a single task instance for a specific DAG and execution date without scheduling. This helps to debug the task by executing it immediately and seeing the output.
Click to reveal answer
beginner
How can you view the logs of a specific task instance using Airflow CLI?
Use the command airflow tasks logs <dag_id> <task_id> <execution_date> to fetch and display the logs for that task instance.
Click to reveal answer
beginner
What does the Airflow CLI command airflow dags list do?
It lists all the DAGs currently available in Airflow. This helps to confirm if your DAG is recognized by Airflow before debugging tasks.
Click to reveal answer
intermediate
Which Airflow CLI command helps you to clear the state of a task instance to rerun it?
The command airflow tasks clear <dag_id> <task_id> --start-date <date> --end-date <date> clears the task state, allowing it to be rerun.
Click to reveal answer
intermediate
Why is it useful to run airflow tasks test instead of triggering the whole DAG?
Running airflow tasks test isolates the task execution, so you can quickly debug and fix issues without waiting for the entire DAG to run or affect downstream tasks.
Click to reveal answer
Which command shows logs for a specific Airflow task instance?
Aairflow tasks logs <dag_id> <task_id> <execution_date>
Bairflow dags list
Cairflow tasks test <dag_id> <task_id> <execution_date>
Dairflow tasks clear <dag_id> <task_id>
What does airflow tasks test do?
AStarts the Airflow webserver
BLists all DAGs
CClears task states
DRuns a single task instance immediately for debugging
How do you clear a task's state to rerun it?
Aairflow tasks test <dag_id> <task_id> <execution_date>
Bairflow tasks clear <dag_id> <task_id> --start-date <date> --end-date <date>
Cairflow dags list
Dairflow tasks logs <dag_id> <task_id> <execution_date>
Which command lists all DAGs in Airflow?
Aairflow tasks clear
Bairflow tasks test
Cairflow dags list
Dairflow tasks logs
Why is running a single task with airflow tasks test helpful?
AIt isolates the task for quick debugging without running the whole DAG
BIt schedules the entire DAG
CIt clears all task states
DIt shows the DAG structure
Explain how you would debug a failing task in Airflow using the CLI.
Think about running, checking logs, and resetting task state.
You got /4 concepts.
    Describe the steps to view logs and rerun a task in Airflow CLI.
    Focus on commands for logs, clearing, and testing tasks.
    You got /3 concepts.