Task Group Ref
A group of tasks in a Dag, shown in the Airflow UI as one node that expands: Python's TaskGroup.
Everything declared in a group carries the group's ID as a prefix, so task stage in group staging is the task staging.stage. A group can stand at either end of an edge, so a whole group can be ordered against a task or another group:
var staging = dag.taskGroup("staging");
staging.task("stage", Stage.class);
extract.before(staging); // every task staging starts with waits for extractAs an upstream, a group stands for its leaves, the tasks nothing else in the group runs after; as a downstream, for its roots, the tasks that run after nothing else in the group. What the group holds is read once, rather than at each edge as Python reads it, so a group's edges can be drawn before its tasks are declared. The edges still resolve in the order they were drawn.
The Airflow UI draws the edges into a group through one join node and the edges out of it through a second join node. For staging, the join nodes have the IDs staging.upstream_join_id and staging.downstream_join_id, and no task or other group in the Dag can take either ID. For example, staging.task("upstream_join_id", Stage.class) fails because the new task's ID would be staging.upstream_join_id. dag.taskGroup("staging") also fails if the Dag already has a task with the ID staging.upstream_join_id.
Properties
Functions
Runs the tasks here after each of previous, carrying no value.
Runs the tasks here before each of next, carrying no value.
Declares a condition in this group, as DagDef.If does for the Dag.
Declares a condition in this group under the task ID <group ID>.<id>.
Declares a switch in this group, as DagDef.Switch does for the Dag.
Declares a switch in this group under the task ID <group ID>.<id>.
Creates a task in this group, registers it with the Dag, and hands back its handle.
Declares a task in this group that starts a run of another Dag, as DagDef.task does for the Dag.
Nests a task group inside this one.