Registers a metadata type if not exists.
tfx.orchestration.portable.mlmd.common_utils.register_type_if_not_exist(
metadata_handler: tfx.orchestration.metadata.Metadata
,
metadata_type: tfx.orchestration.portable.mlmd.common_utils.MetadataType
) -> tfx.orchestration.portable.mlmd.common_utils.MetadataType
Uses existing type if schema is superset of what is needed. Otherwise tries
to register new metadata type.
Args |
metadata_handler
|
A handler to access MLMD store.
|
metadata_type
|
The metadata type to register if does not exist.
|
Returns |
A MetadataType with id
|
Raises |
RuntimeError
|
If new metadata type conflicts with existing schema in MLMD.
|
ValueError
|
If metadata type is not expected.
|