hyperion.repository.asset_collection¶
hyperion.repository.asset_collection
¶
Asset collection is a class that allows you to fetch and store data from the catalog in a type-safe manner.
FeatureAssetSpecification
dataclass
¶
Bases: Generic[CClass]
Specification for fetching feature assets from the catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature
|
type[CClass]
|
The feature model class to fetch. |
required |
start_date
|
DateOrDelta | None
|
The start date or delta from now to fetch the data. |
None
|
end_date
|
DateOrDelta | None
|
The end date or delta from now to fetch the data. |
None
|
AssetCollection
¶
A collection of feature assets that can be fetched from the catalog.
Attributes:
| Name | Type | Description |
|---|---|---|
catalog |
Catalog | None
|
The catalog to fetch the data from. If not set, it will be created from the config. |
max_concurrency |
int
|
The maximum concurrency for fetching data. Default is 8. |
reserved_fields |
ClassVar
|
The reserved field names for the collection. |
_state |
_CollectionState
|
The internal state of the collection. It should under no circumstances be modified directly. |
is_fetched
classmethod
¶
get_data
classmethod
¶
Get the fetched data for the given field.
Source code in hyperion/repository/asset_collection.py
clear
classmethod
¶
Clear all fetched data from the collection.
Source code in hyperion/repository/asset_collection.py
register_specification
classmethod
¶
Register a fetch specification for a field in the collection.
This is normally only called by the FeatureFetchSpecifier descriptor and should
not be called directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_name
|
str
|
The name of the field to register the specification for. |
required |
specification
|
FeatureAssetSpecification[CClass]
|
The fetch specification for the field. |
required |
anchor_timestamp
|
datetime | None
|
The anchor timestamp for fetching the data. |
None
|
Source code in hyperion/repository/asset_collection.py
fetch_all
async
classmethod
¶
Fetch all data for the collection.
Source code in hyperion/repository/asset_collection.py
FeatureFetchSpecifier
¶
Create a feature fetch specifier for the given feature model class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature
|
type[PydanticFeature]
|
The feature model class to fetch. |
required |
start_date
|
DateOrDelta | None
|
The start date or delta from now to fetch the data. |
None
|
end_date
|
DateOrDelta | None
|
The end date or delta from now to fetch the data. |
None
|