0
0
Apache Airflowdevops~10 mins

What is Apache Airflow - Interactive Quiz & Practice

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

Complete the code to import the main Airflow DAG class.

Apache Airflow
from airflow import [1]
Drag options to blanks, or click blank then click option'
AOperator
BTask
CDAG
DScheduler
Attempts:
3 left
💡 Hint
Common Mistakes
Importing Task instead of DAG
Using Scheduler which is a component, not a class
2fill in blank
medium

Complete the code to define a simple Airflow DAG with an ID.

Apache Airflow
dag = DAG(dag_id='[1]')
Drag options to blanks, or click blank then click option'
Atask1
Brun_task
Cexecute
Dmy_workflow
Attempts:
3 left
💡 Hint
Common Mistakes
Using function names or task names instead of a workflow ID
3fill in blank
hard

Fix the error in the Airflow task definition by completing the operator name.

Apache Airflow
task = [1](task_id='print_hello', dag=dag)
Drag options to blanks, or click blank then click option'
APythonOperator
BBashOperator
CEmailOperator
DDummyOperator
Attempts:
3 left
💡 Hint
Common Mistakes
Using BashOperator when Python code is needed
Using DummyOperator which does nothing
4fill in blank
hard

Fill both blanks to create a DAG that runs daily starting from 2023-01-01.

Apache Airflow
dag = DAG(dag_id='daily_run', schedule_interval=[1], start_date=[2])
Drag options to blanks, or click blank then click option'
A'@daily'
B'@hourly'
Cdatetime(2023, 1, 1)
Ddatetime(2022, 12, 31)
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@hourly' for daily schedule
Wrong start_date causing no runs
5fill in blank
hard

Fill all three blanks to define a PythonOperator task that calls a function named 'hello'.

Apache Airflow
task = PythonOperator(task_id=[1], python_callable=[2], dag=[3])
Drag options to blanks, or click blank then click option'
A'say_hello'
Bhello
Cdag
D'hello_task'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting function name in quotes
Using wrong task_id string