schedr.groups

Task groups: with group("load") as load: (see archive/PROJECT.md, Native API: task groups).

A group organises tasks while the DAG is written; it isn’t something that runs. Its tasks’ IDs get its name as a prefix (load.extract), they take its defaults and run_if unless they set their own, and a dependency on the group goes through its first and last tasks, as the whole DAG’s edges make them, made when the with Dag block ends (a mistake is reported then): start >> load makes start run before every task of load with no upstream task inside it, load >> publish makes publish run after every task of load with no downstream task inside it. A dependency on a group that ends with a @branch is a plain order edge from that branch, taken whatever the branch chose. The master schedules ordinary tasks and edges and only checks groups.

class schedr.groups.Group(name, *, defaults=None, run_if=None, uses=None)

Bases: object

A group of tasks: with group("load") as load:; >> orders it as a whole.

Parameters:
  • name (str) – Its name, one ID part (no .): its tasks’ IDs start with it.

  • defaults (StepDefaults | None) – The defaults its tasks get, over the DAG’s (a task’s own arguments win).

  • run_if (RunIf | None) – Its tasks’ trigger rule unless they set their own.

  • uses (Sequence[object] | None) – The resources its tasks need unless they name their own.

Raises:
  • RuntimeError – Outside with Dag(...).

  • IdError – For an invalid name, one used twice in the same parent, or a task’s ID.

property group_id: str

The group’s ID (its parents’ names before its own), once its block started.

Raises:

RuntimeError – Before its with block started.

schedr.groups.group

with group("load", defaults=StepDefaults(retries=3)) as load: (see Group).