Skip to content

Pipeline

Pipeline: declarative composition of steps.

Sequential composition of steps.

Tier 1 API: Pipeline([Load(…), Record(…), Train(…)]).run()

Each step is a callable: step(results) -> results. Steps that inherit from Step get automatic pre-flight validation.

def __init__(self, steps: list):
def run(self, results: Results | None = None) -> Results:

Execute every step in order, returning the final Results.

Each step that inherits from Step is validated against the running Results before it runs.

Args:

  • results: Starting Results object. A fresh empty Results is
  • created when None.

Returns:

  • The Results object after the last step has run.
def validate(self) -> list[str]:

Dry-run validation: check that step reads/writes chain correctly.

Returns:

  • List of all keys that will be available after the pipeline runs.

Raises:

  • KeyError: If a step reads a key that no prior step writes.