kedro.pipeline.node.Node

class kedro.pipeline.node.Node(func, inputs, outputs, *, name=None, tags=None, decorators=None)[source]

Node is an auxiliary class facilitating the operations required to run user-provided functions as part of Kedro pipelines.

__init__(func, inputs, outputs, *, name=None, tags=None, decorators=None)[source]

Create a node in the pipeline by providing a function to be called along with variable names for inputs and/or outputs.

Parameters:
  • func (Callable) – A function that corresponds to the node logic. The function should have at least one input or output.
  • inputs (Union[None, str, List[str], Dict[str, str]]) – The name or the list of the names of variables used as inputs to the function. The number of names should match the number of arguments in the definition of the provided function. When Dict[str, str] is provided, variable names will be mapped to function argument names.
  • outputs (Union[None, str, List[str], Dict[str, str]]) – The name or the list of the names of variables used as outputs to the function. The number of names should match the number of outputs returned by the provided function. When Dict[str, str] is provided, variable names will be mapped to the named outputs the function returns.
  • name (Optional[str]) – Optional node name to be used when displaying the node in logs or any other visualisations.
  • tags (Optional[Iterable[str]]) – Optional set of tags to be applied to the node.
  • decorators (Optional[Iterable[Callable]]) – Optional list of decorators to be applied to the node.
Raises:

ValueError – Raised in the following cases: a) When the provided arguments do not conform to the format suggested by the type hint of the argument. b) When the node produces multiple outputs with the same name. c) An input has the same name as an output.

Methods

__init__(func, inputs, outputs, *[, name, …]) Create a node in the pipeline by providing a function to be called along with variable names for inputs and/or outputs.
decorate(*decorators) Create a new Node by applying the provided decorators to the underlying function.
run([inputs]) Run this node using the provided inputs and return its results in a dictionary.
tag(tags) Create a new Node which is an exact copy of the current one,

Attributes

inputs Return node inputs as a list preserving the original order
name Node’s name.
outputs Return node outputs as a list preserving the original order
tags Return the tags assigned to the node.