hyperion.domain.assets¶
hyperion.domain.assets
¶
Pure asset identities for the catalog.
Split out of :mod:hyperion.entities.catalog (F6 / DDD refactor Step 2). These
types describe asset identity (name, schema version, partition keys, path /
metadata helpers) and depend only on the stdlib and lite-core
:mod:hyperion.dateutils -- no pydantic, pandera or polars. The pandera/polars
feature models live in :mod:hyperion.data.asset_schemas.
AssetProtocol
¶
Bases: Protocol
Protocol for assets in the catalog.
This protocol defines the interface for assets in the catalog.
Attributes:
| Name | Type | Description |
|---|---|---|
asset_type |
ClassVar[AssetType]
|
The type of the asset. |
name |
str
|
The name of the asset. |
schema_version |
int
|
The schema version of the asset. |
get_path
¶
Get the path for the asset with the given prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
The prefix for the path. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The path for the asset. |
to_metadata
¶
Get the metadata for the asset.
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
dict[str, str]: The metadata for the asset. |
DataLakeAsset
dataclass
¶
Data lake asset.
Attributes:
| Name | Type | Description |
|---|---|---|
asset_type |
ClassVar[AssetType]
|
The type of the asset. |
name |
str
|
The name of the asset. |
date |
datetime
|
The date of the asset. |
schema_version |
int
|
The schema version of the asset. |
get_path
¶
Get the path for the asset with the given prefix.
PersistentStoreAsset
dataclass
¶
Persistent store asset.
Attributes:
| Name | Type | Description |
|---|---|---|
asset_type |
ClassVar[AssetType]
|
The type of the asset. |
name |
str
|
The name of the asset. |
schema_version |
int
|
The schema version of the asset. |
get_path
¶
FeatureAsset
dataclass
¶
Feature asset.
Attributes:
| Name | Type | Description |
|---|---|---|
asset_type |
ClassVar[AssetType]
|
The type of the asset. |
name |
str
|
The name of the asset. |
partition_date |
datetime
|
The partition timestamp of the asset. |
resolution |
TimeResolution | str
|
The resolution of the asset. |
schema_version |
int
|
The schema version of the asset. |
partition_keys |
dict[str, str]
|
The partition keys of the asset. |
get_path
¶
Get the path for the asset with the given prefix.
Source code in hyperion/domain/assets.py
to_metadata
¶
Get the metadata for the asset.
Source code in hyperion/domain/assets.py
get_prefixed_path
¶
Get the path with the given prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path. |
required |
prefix
|
str
|
The prefix. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The path with the prefix. |