airflow.decorators.task_group

Implements the @task_group function decorator.

When the decorated function is called, a task group will be created to represent a collection of closely related tasks on the same DAG that should be grouped together when the DAG is displayed graphically.

Module Contents

Functions

task_group(…)

Python TaskGroup decorator.

Attributes

FParams

FReturn

task_group_sig

airflow.decorators.task_group.FParams[source]
airflow.decorators.task_group.FReturn[source]
airflow.decorators.task_group.task_group_sig[source]
airflow.decorators.task_group.task_group(group_id: str | None = None, prefix_group_id: bool = True, parent_group: airflow.utils.task_group.TaskGroup | None = None, dag: airflow.models.dag.DAG | None = None, default_args: dict[str, Any] | None = None, tooltip: str = '', ui_color: str = 'CornflowerBlue', ui_fgcolor: str = '#000', add_suffix_on_collision: bool = False) Callable[[Callable[FParams, FReturn]], _TaskGroupFactory[FParams, FReturn]][source]
airflow.decorators.task_group.task_group(python_callable: Callable[FParams, FReturn]) _TaskGroupFactory[FParams, FReturn]

Python TaskGroup decorator.

This wraps a function into an Airflow TaskGroup. When used as the @task_group() form, all arguments are forwarded to the underlying TaskGroup class. Can be used to parametrize TaskGroup.

Parameters
  • python_callable – Function to decorate.

  • tg_kwargs – Keyword arguments for the TaskGroup object.

Was this entry helpful?