An abstraction for component (BaseNode) artifact inputs.

BaseChannel is often interchangeably used with the term 'channel' (not capital Channel which points to the legacy class name).

Component takes artifact inputs distinguished by each "input key". For example:

trainer = Trainer(
    input key

Here "examples" is the input key of the Examples artifact type. example_gen.outputs['examples'] is a channel. Typically a single channel refers to a list of Artifact of a homogeneous type. Since channel is a declarative abstraction it is not strictly bound to the actual artifact, but is more of an input selector.

The most commonly used channel type is an OutputChannel (in the form of component.outputs["key"], which selects the artifact produced by the component in the same pipeline run (in synchronous execution mode; more information on OutputChannel docstring), and is typically a single artifact.

type The artifact type class that the Channel takes.
is_optional If this channel is optional (e.g. may trigger components at run time if there are no artifacts in the channel). None if not explicetely set.
type_name Name of the artifact type class that Channel takes.



Creates an optional version of self.

By default component input channels are considered required, meaning if the channel does not contain at least 1 artifact, the component will be skipped. Making channel optional disables this requirement and allows componenst to be executed with no artifacts from this channel.

A copy of self which is optional.



Get data dependent nodes of this channel.

Currently only the OutputChannel directly imposes the data dependency, but other channels can also indirectly have a data dependency if they depend on the OutputChannel. Use this abstract method to define transitive data dependency.

A set of data-dependent node IDs.


Return self==value.