0
0
Apache Airflowdevops~10 mins

Task groups for visual organization in Apache Airflow - Interactive Code Practice

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

Complete the code to import the TaskGroup class from Airflow.

Apache Airflow
from airflow.utils.task_group import [1]
Drag options to blanks, or click blank then click option'
ABaseOperator
BTask
CDAG
DTaskGroup
Attempts:
3 left
💡 Hint
Common Mistakes
Importing Task instead of TaskGroup
Importing DAG instead of TaskGroup
Importing BaseOperator instead of TaskGroup
2fill in blank
medium

Complete the code to create a TaskGroup named 'processing'.

Apache Airflow
with [1](group_id='processing') as processing_group:
Drag options to blanks, or click blank then click option'
APythonOperator
BBaseOperator
CTaskGroup
DDAG
Attempts:
3 left
💡 Hint
Common Mistakes
Using DAG instead of TaskGroup
Using PythonOperator instead of TaskGroup
Using BaseOperator instead of TaskGroup
3fill in blank
hard

Fix the error in the code to add a task inside the TaskGroup using PythonOperator.

Apache Airflow
task = PythonOperator(task_id='task1', python_callable=[1])
Drag options to blanks, or click blank then click option'
Aprint_hello
Bprint('hello')
Cprint_hello()
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a function call instead of function name
Passing a string with print statement
Passing the print function instead of a custom function
4fill in blank
hard

Fill both blanks to set dependencies between tasks inside a TaskGroup.

Apache Airflow
task1 [1] task2 [2] task3
Drag options to blanks, or click blank then click option'
A>>
B<<
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using comparison operators like == or !=
Using left shift << which means reverse dependency
5fill in blank
hard

Fill all three blanks to create a TaskGroup and add a PythonOperator task inside it.

Apache Airflow
with [1](group_id='group1') as [2]:
    task = [3](task_id='task1', python_callable=my_func)
Drag options to blanks, or click blank then click option'
ATaskGroup
Bgroup1
CPythonOperator
DDAG
Attempts:
3 left
💡 Hint
Common Mistakes
Using DAG instead of TaskGroup
Using different variable name than group_id
Using BaseOperator instead of PythonOperator