0
0
Apache Airflowdevops~5 mins

Creating a basic DAG file in Apache Airflow - Quick Revision & Summary

Choose your learning style9 modes available
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?
ADirected Acyclic Graph
BData Analysis Group
CDynamic Application Generator
DDistributed Async Gateway
Which Airflow component defines the workflow?
AOperator
BDAG
CTask Instance
DExecutor
How do you import the BashOperator in a DAG file?
Afrom airflow.operators.bash import BashOperator
Bimport BashOperator from airflow
Cfrom airflow import BashOperator
Dimport airflow.bash.BashOperator
What is the purpose of the start_date in default_args?
ATo specify the task retries
BTo set the time tasks should finish
CTo define the task owner
DTo set when the DAG should start running
How do you make task2 run after task1?
Atask1 + task2
Btask2 >> task1
Ctask1 >> task2
Dtask1 & task2
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.