kedro.pipeline.modular_pipeline.pipeline

kedro.pipeline.modular_pipeline.pipeline(pipe, *, inputs=None, outputs=None, parameters=None, tags=None, namespace=None)[source]

Create a Pipeline from a collection of nodes and/or Pipelines.

Parameters:
  • pipe (Iterable[Node | Pipeline] | Pipeline) – The nodes the Pipeline will be made of. If you provide pipelines among the list of nodes, those pipelines will be expanded and all their nodes will become part of this new pipeline.

  • inputs (str | set[str] | dict[str, str] | None) – A name or collection of input names to be exposed as connection points to other pipelines upstream. This is optional; if not provided, the pipeline inputs are automatically inferred from the pipeline structure. When str or set[str] is provided, the listed input names will stay the same as they are named in the provided pipeline. When dict[str, str] is provided, current input names will be mapped to new names. Must only refer to the pipeline’s free inputs.

  • outputs (str | set[str] | dict[str, str] | None) – A name or collection of names to be exposed as connection points to other pipelines downstream. This is optional; if not provided, the pipeline inputs are automatically inferred from the pipeline structure. When str or set[str] is provided, the listed output names will stay the same as they are named in the provided pipeline. When dict[str, str] is provided, current output names will be mapped to new names. Can refer to both the pipeline’s free outputs, as well as intermediate results that need to be exposed.

  • parameters (str | set[str] | dict[str, str] | None) – A name or collection of parameters to namespace. When str or set[str] are provided, the listed parameter names will stay the same as they are named in the provided pipeline. When dict[str, str] is provided, current parameter names will be mapped to new names. The parameters can be specified without the params: prefix.

  • tags (str | Iterable[str] | None) – Optional set of tags to be applied to all the pipeline nodes.

  • namespace (str | None) – A prefix to give to all dataset names, except those explicitly named with the inputs/outputs arguments, and parameter references (params: and parameters).

Raises:
  • ModularPipelineError – When inputs, outputs or parameters are incorrectly specified, or they do not exist on the original pipeline.

  • ValueError – When underlying pipeline nodes inputs/outputs are not any of the expected types (str, dict, list, or None).

Return type:

Pipeline

Returns:

A new Pipeline object.