Skip to content

Yaml Loader

dagpipe.yaml_loader

Loads dagpipe pipelines from YAML configuration.


Summary

Creates fully configured pipeline objects from declarative YAML definitions, including Schema, State subclasses, Node instances, Graph topology, and initial Payloads.

Classes

Pipeline dataclass

Pipeline(engine: Engine, state_cls: Type[State], initial_payload: Payload)

Executable pipeline created from YAML configuration.

Attributes:

Name Type Description
engine Engine

Execution engine responsible for running the pipeline.

state_cls Type[State]

Dynamically created State subclass with configured schema.

initial_payload Payload

Default payload used when execution begins.

Notes

Responsibilities:

1
2
- Encapsulates engine, state type, and initial payload. Provides a simplified interface for executing configured pipelines.
- Safe for concurrent execution if underlying Nodes are thread-safe.
Functions
run
run(payload_override: Optional[Mapping[str, Any]] = None)

Execute pipeline.

Parameters:

Name Type Description Default
payload_override Mapping[str, Any]

Payload values overriding initial payload.

None

Returns:

Type Description

list[State]: Terminal execution states.

Notes

Responsibilities:

1
- Merges override payload with initial payload, creates root State, and executes engine.

Functions

load_pipeline

load_pipeline(path: str) -> Pipeline

Load pipeline from YAML file.

Parameters:

Name Type Description Default
path str

Path to YAML configuration file.

required

Returns:

Name Type Description
Pipeline Pipeline

Executable pipeline instance.

Notes

Responsibilities:

1
- Loads YAML configuration, builds schema, creates State subclass, loads Node instances, builds Graph topology, and initializes Engine.