TaskGroup

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class TaskGroup(val id: String = "")

Marks a nested class that groups the tasks declared inside it, as Python's TaskGroup does.

Declare it as a static nested class of the Dag class, or of another TaskGroup class to nest one group in another. Everything it declares carries its ID as a prefix, so stage in Staging is the task Staging.stage:

@Airflow.TaskGroup
static class Staging {
@Airflow.Task
public long stage(long rows) { ... }

@Airflow.TaskGroup(id = "checks")
static class Checks {
@Airflow.Task
public void nulls(long staged) { ... }
}
}

The wiring class reaches them through the generated view, where the group is both a namespace and a point in the flow: staging().checks().nulls(staged) and extract().before(staging()).

Parameters

id

Group ID within its enclosing group. Empty derives it from the annotated class's name. Must contain only ASCII letters, digits, underscores, or dashes.

Properties

Link copied to clipboard
val id: String