An abstraction for component (BaseNode) artifact inputs.
tfx.v1.types.BaseChannel(
type: Type[_AT], is_optional: Optional[bool] = None
)
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(
examples=example_gen.outputs['examples'])
^^^^^^^^
input key
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
channel
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.
Methods
as_optional
as_optional() -> typing_extensions.Self
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.
Returns | |
---|---|
A copy of self which is optional. |
future
future() -> ChannelWrappedPlaceholder
get_data_dependent_node_ids
@abc.abstractmethod
get_data_dependent_node_ids() -> Set[str]
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.
Returns | |
---|---|
A set of data-dependent node IDs. |
__eq__
__eq__(
other
)
Return self==value.