Recall & Review
beginner
What is a DAG in Airflow?
A DAG (Directed Acyclic Graph) is a collection of tasks organized to reflect their relationships and dependencies. It defines the workflow in Airflow.
Click to reveal answer
beginner
Which Python module do you import to create a DAG in Airflow?You import <code>airflow</code> modules like <code>from airflow import DAG</code> and operators such as <code>from airflow.operators.bash import BashOperator</code>.Click to reveal answer
beginner
What is the purpose of the
default_args dictionary in a DAG file?It sets default parameters for tasks like start date, retries, and retry delay, so you don't have to repeat them for each task.
Click to reveal answer
beginner
How do you schedule a DAG to run every day at midnight?
Set the
schedule_interval parameter to '0 0 * * *' or use @daily in the DAG definition.Click to reveal answer
beginner
How do you define task dependencies in a DAG?
Use the bitshift operators
task1 >> task2 to say task1 runs before task2, or task2 << task1 for the same effect.Click to reveal answer
What does DAG stand for in Airflow?
✗ Incorrect
DAG means Directed Acyclic Graph, which is a way to organize tasks with dependencies.
Which Airflow component defines the workflow?
✗ Incorrect
The DAG defines the workflow by organizing tasks and their order.
How do you import the BashOperator in a DAG file?
✗ Incorrect
The correct import is from airflow.operators.bash import BashOperator.
What is the purpose of the
start_date in default_args?✗ Incorrect
start_date tells Airflow when to start scheduling the DAG.
How do you make task2 run after task1?
✗ Incorrect
Using task1 >> task2 sets task2 to run after task1.
Describe the steps to create a basic DAG file in Airflow.
Think about the order of code and what each part does.
You got /5 concepts.
Explain how task dependencies work in an Airflow DAG and why they are important.
Imagine tasks as steps in a recipe that must happen in sequence.
You got /4 concepts.