![]() |
Base resolver strategy class.
A resolver strategy defines a type behavior used for input selection. A
resolver strategy subclass must override the resolve_artifacts() function
which takes a dict of
Methods
resolve
resolve(
pipeline_info: tfx.orchestration.data_types.PipelineInfo
,
metadata_handler: tfx.orchestration.metadata.Metadata
,
source_channels: Dict[Text, tfx.types.Channel
]
) -> tfx.dsl.components.common.resolver.ResolveResult
Resolves artifacts from channels by querying MLMD.
Args | |
---|---|
pipeline_info
|
PipelineInfo of the current pipeline. We do not want to query artifacts across pipeline boundary. |
metadata_handler
|
a read-only handler to query MLMD. |
source_channels
|
a key -> channel dict which contains the info of the source channels. |
Returns | |
---|---|
a ResolveResult instance. |
Raises | |
---|---|
DeprecationWarning
|
when it is called. |
resolve_artifacts
@abc.abstractmethod
resolve_artifacts( metadata_handler:
tfx.orchestration.metadata.Metadata
, input_dict: Dict[Text, List[types.Artifact]] ) -> Optional[Dict[Text, List[types.Artifact]]]
Resolves artifacts from channels, optionally querying MLMD if needed.
In asynchronous execution mode, resolver classes may composed in sequence where the resolve_artifacts() result from the previous resolver instance would be passed to the next resolver instance's resolve_artifacts() inputs.
If resolve_artifacts() returns None, it is considered as "no inputs available", and the remaining resolvers will not be executed.
Also if resolve_artifacts() omits any key from the input_dict it will not be available from the downstream resolver instances. General recommendation is to preserve all keys in the input_dict unless you have specific reason.
Args | |
---|---|
metadata_handler
|
A metadata handler to access MLMD store. |
input_dict
|
The input_dict to resolve from. |
Returns | |
---|---|
If all entries has enough data after the resolving, returns the resolved input_dict. Otherise, return None. |