nat.plugins.data_flywheel.observability.schema.schema_registry#

Attributes#

Classes#

SchemaRegistry

Registry for managing schema contracts and versions.

Module Contents#

logger#
T#
class SchemaRegistry#

Registry for managing schema contracts and versions.

_schemas: dict[str, dict[str, type[pydantic.BaseModel]]]#
classmethod register(name: str, version: str)#

Decorator to register a schema class for a specific destination and version.

Args:

name (str): The destination/exporter name (e.g., “elasticsearch”) version (str): The version string (e.g., “1.0”, “1.1”)

Returns:

The decorator function

classmethod get_schema(name: str, version: str) type[pydantic.BaseModel]#

Get the schema class for a specific destination and version.

Args:

name (str): The destination/exporter name (e.g., “elasticsearch”) version (str): The version string to look up

Returns:

type[BaseModel]: The Pydantic model class for the requested destination and version

Raises:

KeyError: If the name:version combination is not registered.

classmethod get_available_schemas() list[str]#

Get all registered schema name:version combinations.

Returns:

list[str]: List of registered schema keys in “name:version” format

classmethod get_schemas_for_destination(name: str) list[str]#

Get all registered schema versions for a specific destination.

Args:

name (str): The destination/exporter name

Returns:

list[str]: List of version strings for the specified destination

classmethod get_available_destinations() list[str]#

Get all registered destination names.

Returns:

list[str]: List of registered destination names

classmethod is_registered(name: str, version: str) bool#

Check if a name:version combination is registered.

Args:

name (str): The destination/exporter name version (str): The version string to check

Returns:

bool: True if the name:version is registered, False otherwise

classmethod clear() None#

Clear all registered schemas.

register_schema#
get_schema#
get_available_schemas#
get_available_destinations#
get_schemas_for_destination#
is_registered#