🗓️Airflow Task Group
Also known as TaskGroup, Task Group, @task_group
A box that holds related Airflow tasks. Big DAGs get easier to read.
Think of it like
It is like a folder on a desk. Ten loose sheets become one neat folder you can open.
Example
A DAG loads twelve regions. Jack puts the twelve load tasks in a group called load_regions. The graph now shows one box he can open.
Why it matters
Big DAGs turn into a wall of boxes. Groups bring back the shape a person can follow.
Definition
Example code
python
from airflow.sdk import task_group
@task_group
def load_regions():
load_europe()
load_asia()Common mistake
Key takeaways
- 1Tidy view. Many tasks show as one box.
- 2Same DAG. Not a separate pipeline.
- 3Shared defaults. A group can set its own.