0
0
Apache Airflowdevops~10 mins

Why DAG design determines pipeline reliability in Apache Airflow - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a DAG with a daily schedule.

Apache Airflow
dag = DAG('example_dag', schedule_interval=[1], start_date=datetime(2024, 1, 1))
Drag options to blanks, or click blank then click option'
A'@daily'
BNone
C'@weekly'
D'@hourly'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@hourly' runs the DAG every hour, not daily.
Using None disables scheduling.
2fill in blank
medium

Complete the code to set task dependencies so task2 runs after task1.

Apache Airflow
task1 >> [1]
Drag options to blanks, or click blank then click option'
Atask3
Btask4
Ctask1
Dtask2
Attempts:
3 left
💡 Hint
Common Mistakes
Setting task1 after itself causes a circular dependency.
Choosing a task not defined in the DAG.
3fill in blank
hard

Fix the error in the DAG definition by completing the missing argument.

Apache Airflow
dag = DAG('my_dag', schedule_interval='@daily', [1]=datetime(2024, 1, 1))
Drag options to blanks, or click blank then click option'
Aend_date
Bstart_date
Cexecution_date
Drun_date
Attempts:
3 left
💡 Hint
Common Mistakes
Using end_date instead of start_date.
Using non-existent arguments like execution_date.
4fill in blank
hard

Fill both blanks to create a task that runs a Python function using the correct operator and DAG.

Apache Airflow
task = [1](task_id='print_hello', python_callable=print_hello, dag=[2])
Drag options to blanks, or click blank then click option'
APythonOperator
BBashOperator
Cdag
Dmy_dag
Attempts:
3 left
💡 Hint
Common Mistakes
Using BashOperator for Python functions.
Passing the wrong DAG variable.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps task IDs to their start dates if the start date is after 2024-01-01.

Apache Airflow
task_start_dates = {task.task_id: task.[1] for task in tasks if task.[2] [3] datetime(2024, 1, 1)}
Drag options to blanks, or click blank then click option'
Astart_date
Bend_date
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using end_date instead of start_date.
Using the wrong comparison operator.