baybe.utils.metadata.to_metadata

baybe.utils.metadata.to_metadata(value: dict[str, Any] | _TMetaData, cls: type[_TMetaData], /)[source]

Convert a dictionary to Metadata (with Metadata passthrough).

Parameters:
Return type:

TypeVar(_TMetaData, bound= Metadata)

Returns:

The created metadata instance of the requested Metadata subclass.

Raises:

TypeError – If the input is not a dictionary or of the specified Metadata type.