Generates task from active execution (if any).
tfx.orchestration.experimental.core.task_gen_utils.generate_task_from_active_execution(
metadata_handler: tfx.orchestration.metadata.Metadata
,
pipeline: pipeline_pb2.Pipeline,
node: pipeline_pb2.PipelineNode,
executions: Iterable[metadata_store_pb2.Execution],
is_cancelled: bool = False
) -> Optional[tfx.orchestration.experimental.core.task.Task
]
Returns None
if a task cannot be generated from active execution.
Args |
metadata_handler
|
A handler to access MLMD db.
|
pipeline
|
The pipeline containing the node.
|
node
|
The pipeline node for which to generate a task.
|
executions
|
A sequence of all executions for the given node.
|
is_cancelled
|
Sets is_cancelled in ExecNodeTask.
|
Returns |
A Task proto if active execution exists for the node. None otherwise.
|
Raises |
RuntimeError
|
If there are multiple active executions for the node.
|