hyperion.ports.schema_registry¶
hyperion.ports.schema_registry
¶
Port: schema store abstraction.
Abstract :class:SchemaStore base. Concrete adapters (LocalSchemaStore,
S3SchemaStore) live in hyperion.adapters.schema_registry.*;
_create_new delegates backend selection to :mod:hyperion.composition
(the single composition root). AssetProtocol / AssetType are
referenced only in annotations, so this port stays free of the pandera/polars
data stack.
SchemaStore
¶
Bases: ABC
Abstract base class for schema stores.
Initialize the schema store with the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path to the schema store. |
required |
Source code in hyperion/ports/schema_registry.py
get_asset_schema
¶
Get the schema for the given asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset
|
AssetProtocol
|
The asset to get the schema for. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: The schema for the asset. |
Source code in hyperion/ports/schema_registry.py
get_schema_from_path
abstractmethod
¶
Get the schema given by its path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema_path
|
str
|
The path to the schema. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: The schema. |
get_schema
abstractmethod
¶
Get the schema for the asset with the given name and version.
from_path
staticmethod
¶
Get a schema store from the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path to the schema store. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
SchemaStore |
SchemaStore
|
The schema store. |
Source code in hyperion/ports/schema_registry.py
from_config
staticmethod
¶
Get a schema store from the configuration.
Returns:
| Name | Type | Description |
|---|---|---|
SchemaStore |
SchemaStore
|
The schema store. |