tfx.orchestration.portable.mlmd.common_utils.register_type_if_not_exist

Registers a metadata type if not exists.

Uses existing type if schema is superset of what is needed. Otherwise tries to register new metadata type.

metadata_handler A handler to access MLMD store.
metadata_type The metadata type to register if does not exist.

A MetadataType with id

RuntimeError If new metadata type conflicts with existing schema in MLMD.
ValueError If metadata type is not expected.