feast.infra.registry package

Submodules

feast.infra.registry.base_registry module

class feast.infra.registry.base_registry.BaseRegistry[source]

Bases: ABC

The interface that Feast uses to apply, list, retrieve, and delete Feast objects (e.g. entities, feature views, and data sources).

abstract apply_data_source(data_source: DataSource, project: str, commit: bool = True)[source]

Registers a single data source with Feast

Parameters:
  • data_source – A data source that will be registered

  • project – Feast project that this data source belongs to

  • commit – Whether to immediately commit to the registry

abstract apply_entity(entity: Entity, project: str, commit: bool = True)[source]

Registers a single entity with Feast

Parameters:
  • entity – Entity that will be registered

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

abstract apply_feature_service(feature_service: FeatureService, project: str, commit: bool = True)[source]

Registers a single feature service with Feast

Parameters:
  • feature_service – A feature service that will be registered

  • project – Feast project that this entity belongs to

abstract apply_feature_view(feature_view: BaseFeatureView, project: str, commit: bool = True)[source]

Registers a single feature view with Feast

Parameters:
  • feature_view – Feature view that will be registered

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

abstract apply_materialization(feature_view: FeatureView, project: str, start_date: datetime, end_date: datetime, commit: bool = True)[source]

Updates materialization intervals tracked for a single feature view in Feast

Parameters:
  • feature_view – Feature view that will be updated with an additional materialization interval tracked

  • project – Feast project that this feature view belongs to

  • start_date (datetime) – Start date of the materialization interval to track

  • end_date (datetime) – End date of the materialization interval to track

  • commit – Whether the change should be persisted immediately

abstract apply_saved_dataset(saved_dataset: SavedDataset, project: str, commit: bool = True)[source]

Stores a saved dataset metadata with Feast

Parameters:
  • saved_dataset – SavedDataset that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

abstract apply_user_metadata(project: str, feature_view: BaseFeatureView, metadata_bytes: bytes | None)[source]
abstract apply_validation_reference(validation_reference: ValidationReference, project: str, commit: bool = True)[source]

Persist a validation reference

Parameters:
  • validation_reference – ValidationReference that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

abstract commit()[source]

Commits the state of the registry cache to the remote registry store.

abstract delete_data_source(name: str, project: str, commit: bool = True)[source]

Deletes a data source or raises an exception if not found.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • commit – Whether the change should be persisted immediately

abstract delete_entity(name: str, project: str, commit: bool = True)[source]

Deletes an entity or raises an exception if not found.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

abstract delete_feature_service(name: str, project: str, commit: bool = True)[source]

Deletes a feature service or raises an exception if not found.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • commit – Whether the change should be persisted immediately

abstract delete_feature_view(name: str, project: str, commit: bool = True)[source]

Deletes a feature view or raises an exception if not found.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

delete_saved_dataset(name: str, project: str, allow_cache: bool = False)[source]

Delete a saved dataset.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified SavedDataset, or raises an exception if none is found

abstract delete_validation_reference(name: str, project: str, commit: bool = True)[source]

Deletes a validation reference or raises an exception if not found.

Parameters:
  • name – Name of validation reference

  • project – Feast project that this object belongs to

  • commit – Whether the change should be persisted immediately

abstract get_data_source(name: str, project: str, allow_cache: bool = False) DataSource[source]

Retrieves a data source.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • allow_cache – Whether to allow returning this data source from a cached registry

Returns:

Returns either the specified data source, or raises an exception if none is found

abstract get_entity(name: str, project: str, allow_cache: bool = False) Entity[source]

Retrieves an entity.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

Returns either the specified entity, or raises an exception if none is found

abstract get_feature_service(name: str, project: str, allow_cache: bool = False) FeatureService[source]

Retrieves a feature service.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • allow_cache – Whether to allow returning this feature service from a cached registry

Returns:

Returns either the specified feature service, or raises an exception if none is found

abstract get_feature_view(name: str, project: str, allow_cache: bool = False) FeatureView[source]

Retrieves a feature view.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

abstract get_infra(project: str, allow_cache: bool = False) Infra[source]

Retrieves the stored Infra object.

Parameters:
  • project – Feast project that the Infra object refers to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

The stored Infra object.

abstract get_on_demand_feature_view(name: str, project: str, allow_cache: bool = False) OnDemandFeatureView[source]

Retrieves an on demand feature view.

Parameters:
  • name – Name of on demand feature view

  • project – Feast project that this on demand feature view belongs to

  • allow_cache – Whether to allow returning this on demand feature view from a cached registry

Returns:

Returns either the specified on demand feature view, or raises an exception if none is found

abstract get_request_feature_view(name: str, project: str) RequestFeatureView[source]

Retrieves a request feature view.

Parameters:
  • name – Name of request feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

abstract get_saved_dataset(name: str, project: str, allow_cache: bool = False) SavedDataset[source]

Retrieves a saved dataset.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified SavedDataset, or raises an exception if none is found

abstract get_stream_feature_view(name: str, project: str, allow_cache: bool = False)[source]

Retrieves a stream feature view.

Parameters:
  • name – Name of stream feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

abstract get_user_metadata(project: str, feature_view: BaseFeatureView) bytes | None[source]
abstract get_validation_reference(name: str, project: str, allow_cache: bool = False) ValidationReference[source]

Retrieves a validation reference.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified ValidationReference, or raises an exception if none is found

abstract list_data_sources(project: str, allow_cache: bool = False) List[DataSource][source]

Retrieve a list of data sources from the registry

Parameters:
  • project – Filter data source based on project name

  • allow_cache – Whether to allow returning data sources from a cached registry

Returns:

List of data sources

abstract list_entities(project: str, allow_cache: bool = False) List[Entity][source]

Retrieve a list of entities from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of entities

abstract list_feature_services(project: str, allow_cache: bool = False) List[FeatureService][source]

Retrieve a list of feature services from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of feature services

abstract list_feature_views(project: str, allow_cache: bool = False) List[FeatureView][source]

Retrieve a list of feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of feature views

abstract list_on_demand_feature_views(project: str, allow_cache: bool = False) List[OnDemandFeatureView][source]

Retrieve a list of on demand feature views from the registry

Parameters:
  • project – Filter on demand feature views based on project name

  • allow_cache – Whether to allow returning on demand feature views from a cached registry

Returns:

List of on demand feature views

list_project_metadata(project: str, allow_cache: bool = False) List[ProjectMetadata][source]

Retrieves project metadata

Parameters:
  • project – Filter metadata based on project name

  • allow_cache – Allow returning feature views from the cached registry

Returns:

List of project metadata

abstract list_request_feature_views(project: str, allow_cache: bool = False) List[RequestFeatureView][source]

Retrieve a list of request feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

abstract list_saved_datasets(project: str, allow_cache: bool = False) List[SavedDataset][source]

Retrieves a list of all saved datasets in specified project

Parameters:
  • project – Feast project

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns the list of SavedDatasets

abstract list_stream_feature_views(project: str, allow_cache: bool = False) List[StreamFeatureView][source]

Retrieve a list of stream feature views from the registry

Parameters:
  • project – Filter stream feature views based on project name

  • allow_cache – Whether to allow returning stream feature views from a cached registry

Returns:

List of stream feature views

list_validation_references(project: str, allow_cache: bool = False) List[ValidationReference][source]

Retrieve a list of validation references from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

abstract proto() Registry[source]

Retrieves a proto version of the registry.

Returns:

The registry proto object.

abstract refresh(project: str | None = None)[source]

Refreshes the state of the registry cache by fetching the registry state from the remote registry store.

to_dict(project: str) Dict[str, List[Any]][source]

Returns a dictionary representation of the registry contents for the specified project.

For each list in the dictionary, the elements are sorted by name, so this method can be used to compare two registries.

Parameters:

project – Feast project to convert to a dict

abstract update_infra(infra: Infra, project: str, commit: bool = True)[source]

Updates the stored Infra object.

Parameters:
  • infra – The new Infra object to be stored.

  • project – Feast project that the Infra object refers to

  • commit – Whether the change should be persisted immediately

feast.infra.registry.file module

class feast.infra.registry.file.FileRegistryStore(registry_config: RegistryConfig, repo_path: Path)[source]

Bases: RegistryStore

get_registry_proto()[source]

Retrieves the registry proto from the registry path. If there is no file at that path, raises a FileNotFoundError.

Returns:

Returns either the registry proto stored at the registry path, or an empty registry proto.

teardown()[source]

Tear down the registry.

update_registry_proto(registry_proto: Registry)[source]

Overwrites the current registry proto with the proto passed in. This method writes to the registry path.

Parameters:

registry_proto – the new RegistryProto

feast.infra.registry.gcs module

class feast.infra.registry.gcs.GCSRegistryStore(registry_config: RegistryConfig, repo_path: Path)[source]

Bases: RegistryStore

get_registry_proto()[source]

Retrieves the registry proto from the registry path. If there is no file at that path, raises a FileNotFoundError.

Returns:

Returns either the registry proto stored at the registry path, or an empty registry proto.

teardown()[source]

Tear down the registry.

update_registry_proto(registry_proto: Registry)[source]

Overwrites the current registry proto with the proto passed in. This method writes to the registry path.

Parameters:

registry_proto – the new RegistryProto

feast.infra.registry.registry module

class feast.infra.registry.registry.FeastObjectType(value)[source]

Bases: Enum

An enumeration.

DATA_SOURCE = 'data source'
ENTITY = 'entity'
FEATURE_SERVICE = 'feature service'
FEATURE_VIEW = 'feature view'
ON_DEMAND_FEATURE_VIEW = 'on demand feature view'
REQUEST_FEATURE_VIEW = 'request feature view'
STREAM_FEATURE_VIEW = 'stream feature view'
static get_objects_from_registry(registry: BaseRegistry, project: str) Dict[FeastObjectType, List[Any]][source]
static get_objects_from_repo_contents(repo_contents: RepoContents) Dict[FeastObjectType, List[Any]][source]
class feast.infra.registry.registry.Registry(project: str, registry_config: RegistryConfig | None, repo_path: Path | None)[source]

Bases: BaseRegistry

apply_data_source(data_source: DataSource, project: str, commit: bool = True)[source]

Registers a single data source with Feast

Parameters:
  • data_source – A data source that will be registered

  • project – Feast project that this data source belongs to

  • commit – Whether to immediately commit to the registry

apply_entity(entity: Entity, project: str, commit: bool = True)[source]

Registers a single entity with Feast

Parameters:
  • entity – Entity that will be registered

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

apply_feature_service(feature_service: FeatureService, project: str, commit: bool = True)[source]

Registers a single feature service with Feast

Parameters:
  • feature_service – A feature service that will be registered

  • project – Feast project that this entity belongs to

apply_feature_view(feature_view: BaseFeatureView, project: str, commit: bool = True)[source]

Registers a single feature view with Feast

Parameters:
  • feature_view – Feature view that will be registered

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

apply_materialization(feature_view: FeatureView, project: str, start_date: datetime, end_date: datetime, commit: bool = True)[source]

Updates materialization intervals tracked for a single feature view in Feast

Parameters:
  • feature_view – Feature view that will be updated with an additional materialization interval tracked

  • project – Feast project that this feature view belongs to

  • start_date (datetime) – Start date of the materialization interval to track

  • end_date (datetime) – End date of the materialization interval to track

  • commit – Whether the change should be persisted immediately

apply_saved_dataset(saved_dataset: SavedDataset, project: str, commit: bool = True)[source]

Stores a saved dataset metadata with Feast

Parameters:
  • saved_dataset – SavedDataset that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

apply_user_metadata(project: str, feature_view: BaseFeatureView, metadata_bytes: bytes | None)[source]
apply_validation_reference(validation_reference: ValidationReference, project: str, commit: bool = True)[source]

Persist a validation reference

Parameters:
  • validation_reference – ValidationReference that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

cached_registry_proto: Registry | None = None
cached_registry_proto_created: datetime | None = None
cached_registry_proto_ttl: timedelta
clone() Registry[source]
commit()[source]

Commits the state of the registry cache to the remote registry store.

delete_data_source(name: str, project: str, commit: bool = True)[source]

Deletes a data source or raises an exception if not found.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • commit – Whether the change should be persisted immediately

delete_entity(name: str, project: str, commit: bool = True)[source]

Deletes an entity or raises an exception if not found.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

delete_feature_service(name: str, project: str, commit: bool = True)[source]

Deletes a feature service or raises an exception if not found.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • commit – Whether the change should be persisted immediately

delete_feature_view(name: str, project: str, commit: bool = True)[source]

Deletes a feature view or raises an exception if not found.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

delete_validation_reference(name: str, project: str, commit: bool = True)[source]

Deletes a validation reference or raises an exception if not found.

Parameters:
  • name – Name of validation reference

  • project – Feast project that this object belongs to

  • commit – Whether the change should be persisted immediately

get_data_source(name: str, project: str, allow_cache: bool = False) DataSource[source]

Retrieves a data source.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • allow_cache – Whether to allow returning this data source from a cached registry

Returns:

Returns either the specified data source, or raises an exception if none is found

get_entity(name: str, project: str, allow_cache: bool = False) Entity[source]

Retrieves an entity.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

Returns either the specified entity, or raises an exception if none is found

get_feature_service(name: str, project: str, allow_cache: bool = False) FeatureService[source]

Retrieves a feature service.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • allow_cache – Whether to allow returning this feature service from a cached registry

Returns:

Returns either the specified feature service, or raises an exception if none is found

get_feature_view(name: str, project: str, allow_cache: bool = False) FeatureView[source]

Retrieves a feature view.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_infra(project: str, allow_cache: bool = False) Infra[source]

Retrieves the stored Infra object.

Parameters:
  • project – Feast project that the Infra object refers to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

The stored Infra object.

get_on_demand_feature_view(name: str, project: str, allow_cache: bool = False) OnDemandFeatureView[source]

Retrieves an on demand feature view.

Parameters:
  • name – Name of on demand feature view

  • project – Feast project that this on demand feature view belongs to

  • allow_cache – Whether to allow returning this on demand feature view from a cached registry

Returns:

Returns either the specified on demand feature view, or raises an exception if none is found

get_request_feature_view(name: str, project: str)[source]

Retrieves a request feature view.

Parameters:
  • name – Name of request feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_saved_dataset(name: str, project: str, allow_cache: bool = False) SavedDataset[source]

Retrieves a saved dataset.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified SavedDataset, or raises an exception if none is found

get_stream_feature_view(name: str, project: str, allow_cache: bool = False) StreamFeatureView[source]

Retrieves a stream feature view.

Parameters:
  • name – Name of stream feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_user_metadata(project: str, feature_view: BaseFeatureView) bytes | None[source]
get_validation_reference(name: str, project: str, allow_cache: bool = False) ValidationReference[source]

Retrieves a validation reference.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified ValidationReference, or raises an exception if none is found

list_data_sources(project: str, allow_cache: bool = False) List[DataSource][source]

Retrieve a list of data sources from the registry

Parameters:
  • project – Filter data source based on project name

  • allow_cache – Whether to allow returning data sources from a cached registry

Returns:

List of data sources

list_entities(project: str, allow_cache: bool = False) List[Entity][source]

Retrieve a list of entities from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of entities

list_feature_services(project: str, allow_cache: bool = False) List[FeatureService][source]

Retrieve a list of feature services from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of feature services

list_feature_views(project: str, allow_cache: bool = False) List[FeatureView][source]

Retrieve a list of feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of feature views

list_on_demand_feature_views(project: str, allow_cache: bool = False) List[OnDemandFeatureView][source]

Retrieve a list of on demand feature views from the registry

Parameters:
  • project – Filter on demand feature views based on project name

  • allow_cache – Whether to allow returning on demand feature views from a cached registry

Returns:

List of on demand feature views

list_project_metadata(project: str, allow_cache: bool = False) List[ProjectMetadata][source]

Retrieves project metadata

Parameters:
  • project – Filter metadata based on project name

  • allow_cache – Allow returning feature views from the cached registry

Returns:

List of project metadata

list_request_feature_views(project: str, allow_cache: bool = False) List[RequestFeatureView][source]

Retrieve a list of request feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

list_saved_datasets(project: str, allow_cache: bool = False) List[SavedDataset][source]

Retrieves a list of all saved datasets in specified project

Parameters:
  • project – Feast project

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns the list of SavedDatasets

list_stream_feature_views(project: str, allow_cache: bool = False) List[StreamFeatureView][source]

Retrieve a list of stream feature views from the registry

Parameters:
  • project – Filter stream feature views based on project name

  • allow_cache – Whether to allow returning stream feature views from a cached registry

Returns:

List of stream feature views

list_validation_references(project: str, allow_cache: bool = False) List[ValidationReference][source]

Retrieve a list of validation references from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

proto() Registry[source]

Retrieves a proto version of the registry.

Returns:

The registry proto object.

refresh(project: str | None = None)[source]

Refreshes the state of the registry cache by fetching the registry state from the remote registry store.

teardown()[source]

Tears down (removes) the registry.

update_infra(infra: Infra, project: str, commit: bool = True)[source]

Updates the stored Infra object.

Parameters:
  • infra – The new Infra object to be stored.

  • project – Feast project that the Infra object refers to

  • commit – Whether the change should be persisted immediately

feast.infra.registry.registry.get_registry_store_class_from_scheme(registry_path: str)[source]
feast.infra.registry.registry.get_registry_store_class_from_type(registry_store_type: str)[source]

feast.infra.registry.registry_store module

class feast.infra.registry.registry_store.NoopRegistryStore[source]

Bases: RegistryStore

get_registry_proto() Registry[source]

Retrieves the registry proto from the registry path. If there is no file at that path, raises a FileNotFoundError.

Returns:

Returns either the registry proto stored at the registry path, or an empty registry proto.

teardown()[source]

Tear down the registry.

update_registry_proto(registry_proto: Registry)[source]

Overwrites the current registry proto with the proto passed in. This method writes to the registry path.

Parameters:

registry_proto – the new RegistryProto

class feast.infra.registry.registry_store.RegistryStore[source]

Bases: ABC

A registry store is a storage backend for the Feast registry.

abstract get_registry_proto() Registry[source]

Retrieves the registry proto from the registry path. If there is no file at that path, raises a FileNotFoundError.

Returns:

Returns either the registry proto stored at the registry path, or an empty registry proto.

abstract teardown()[source]

Tear down the registry.

abstract update_registry_proto(registry_proto: Registry)[source]

Overwrites the current registry proto with the proto passed in. This method writes to the registry path.

Parameters:

registry_proto – the new RegistryProto

feast.infra.registry.s3 module

class feast.infra.registry.s3.S3RegistryStore(registry_config: RegistryConfig, repo_path: Path)[source]

Bases: RegistryStore

get_registry_proto()[source]

Retrieves the registry proto from the registry path. If there is no file at that path, raises a FileNotFoundError.

Returns:

Returns either the registry proto stored at the registry path, or an empty registry proto.

teardown()[source]

Tear down the registry.

update_registry_proto(registry_proto: Registry)[source]

Overwrites the current registry proto with the proto passed in. This method writes to the registry path.

Parameters:

registry_proto – the new RegistryProto

feast.infra.registry.sql module

class feast.infra.registry.sql.FeastMetadataKeys(value)[source]

Bases: Enum

An enumeration.

LAST_UPDATED_TIMESTAMP = 'last_updated_timestamp'
PROJECT_UUID = 'project_uuid'
class feast.infra.registry.sql.SqlRegistry(registry_config: RegistryConfig | None, project: str, repo_path: Path | None)[source]

Bases: BaseRegistry

apply_data_source(data_source: DataSource, project: str, commit: bool = True)[source]

Registers a single data source with Feast

Parameters:
  • data_source – A data source that will be registered

  • project – Feast project that this data source belongs to

  • commit – Whether to immediately commit to the registry

apply_entity(entity: Entity, project: str, commit: bool = True)[source]

Registers a single entity with Feast

Parameters:
  • entity – Entity that will be registered

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

apply_feature_service(feature_service: FeatureService, project: str, commit: bool = True)[source]

Registers a single feature service with Feast

Parameters:
  • feature_service – A feature service that will be registered

  • project – Feast project that this entity belongs to

apply_feature_view(feature_view: BaseFeatureView, project: str, commit: bool = True)[source]

Registers a single feature view with Feast

Parameters:
  • feature_view – Feature view that will be registered

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

apply_materialization(feature_view: FeatureView, project: str, start_date: datetime, end_date: datetime, commit: bool = True)[source]

Updates materialization intervals tracked for a single feature view in Feast

Parameters:
  • feature_view – Feature view that will be updated with an additional materialization interval tracked

  • project – Feast project that this feature view belongs to

  • start_date (datetime) – Start date of the materialization interval to track

  • end_date (datetime) – End date of the materialization interval to track

  • commit – Whether the change should be persisted immediately

apply_saved_dataset(saved_dataset: SavedDataset, project: str, commit: bool = True)[source]

Stores a saved dataset metadata with Feast

Parameters:
  • saved_dataset – SavedDataset that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

apply_user_metadata(project: str, feature_view: BaseFeatureView, metadata_bytes: bytes | None)[source]
apply_validation_reference(validation_reference: ValidationReference, project: str, commit: bool = True)[source]

Persist a validation reference

Parameters:
  • validation_reference – ValidationReference that will be added / updated to registry

  • project – Feast project that this dataset belongs to

  • commit – Whether the change should be persisted immediately

commit()[source]

Commits the state of the registry cache to the remote registry store.

delete_data_source(name: str, project: str, commit: bool = True)[source]

Deletes a data source or raises an exception if not found.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • commit – Whether the change should be persisted immediately

delete_entity(name: str, project: str, commit: bool = True)[source]

Deletes an entity or raises an exception if not found.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • commit – Whether the change should be persisted immediately

delete_feature_service(name: str, project: str, commit: bool = True)[source]

Deletes a feature service or raises an exception if not found.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • commit – Whether the change should be persisted immediately

delete_feature_view(name: str, project: str, commit: bool = True)[source]

Deletes a feature view or raises an exception if not found.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • commit – Whether the change should be persisted immediately

delete_validation_reference(name: str, project: str, commit: bool = True)[source]

Deletes a validation reference or raises an exception if not found.

Parameters:
  • name – Name of validation reference

  • project – Feast project that this object belongs to

  • commit – Whether the change should be persisted immediately

get_data_source(name: str, project: str, allow_cache: bool = False) DataSource[source]

Retrieves a data source.

Parameters:
  • name – Name of data source

  • project – Feast project that this data source belongs to

  • allow_cache – Whether to allow returning this data source from a cached registry

Returns:

Returns either the specified data source, or raises an exception if none is found

get_entity(name: str, project: str, allow_cache: bool = False) Entity[source]

Retrieves an entity.

Parameters:
  • name – Name of entity

  • project – Feast project that this entity belongs to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

Returns either the specified entity, or raises an exception if none is found

get_feature_service(name: str, project: str, allow_cache: bool = False) FeatureService[source]

Retrieves a feature service.

Parameters:
  • name – Name of feature service

  • project – Feast project that this feature service belongs to

  • allow_cache – Whether to allow returning this feature service from a cached registry

Returns:

Returns either the specified feature service, or raises an exception if none is found

get_feature_view(name: str, project: str, allow_cache: bool = False) FeatureView[source]

Retrieves a feature view.

Parameters:
  • name – Name of feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_infra(project: str, allow_cache: bool = False) Infra[source]

Retrieves the stored Infra object.

Parameters:
  • project – Feast project that the Infra object refers to

  • allow_cache – Whether to allow returning this entity from a cached registry

Returns:

The stored Infra object.

get_on_demand_feature_view(name: str, project: str, allow_cache: bool = False) OnDemandFeatureView[source]

Retrieves an on demand feature view.

Parameters:
  • name – Name of on demand feature view

  • project – Feast project that this on demand feature view belongs to

  • allow_cache – Whether to allow returning this on demand feature view from a cached registry

Returns:

Returns either the specified on demand feature view, or raises an exception if none is found

get_request_feature_view(name: str, project: str, allow_cache: bool = False)[source]

Retrieves a request feature view.

Parameters:
  • name – Name of request feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_saved_dataset(name: str, project: str, allow_cache: bool = False) SavedDataset[source]

Retrieves a saved dataset.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified SavedDataset, or raises an exception if none is found

get_stream_feature_view(name: str, project: str, allow_cache: bool = False)[source]

Retrieves a stream feature view.

Parameters:
  • name – Name of stream feature view

  • project – Feast project that this feature view belongs to

  • allow_cache – Allow returning feature view from the cached registry

Returns:

Returns either the specified feature view, or raises an exception if none is found

get_user_metadata(project: str, feature_view: BaseFeatureView) bytes | None[source]
get_validation_reference(name: str, project: str, allow_cache: bool = False) ValidationReference[source]

Retrieves a validation reference.

Parameters:
  • name – Name of dataset

  • project – Feast project that this dataset belongs to

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns either the specified ValidationReference, or raises an exception if none is found

list_data_sources(project: str, allow_cache: bool = False) List[DataSource][source]

Retrieve a list of data sources from the registry

Parameters:
  • project – Filter data source based on project name

  • allow_cache – Whether to allow returning data sources from a cached registry

Returns:

List of data sources

list_entities(project: str, allow_cache: bool = False) List[Entity][source]

Retrieve a list of entities from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of entities

list_feature_services(project: str, allow_cache: bool = False) List[FeatureService][source]

Retrieve a list of feature services from the registry

Parameters:
  • allow_cache – Whether to allow returning entities from a cached registry

  • project – Filter entities based on project name

Returns:

List of feature services

list_feature_views(project: str, allow_cache: bool = False) List[FeatureView][source]

Retrieve a list of feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of feature views

list_on_demand_feature_views(project: str, allow_cache: bool = False) List[OnDemandFeatureView][source]

Retrieve a list of on demand feature views from the registry

Parameters:
  • project – Filter on demand feature views based on project name

  • allow_cache – Whether to allow returning on demand feature views from a cached registry

Returns:

List of on demand feature views

list_project_metadata(project: str, allow_cache: bool = False) List[ProjectMetadata][source]

Retrieves project metadata

Parameters:
  • project – Filter metadata based on project name

  • allow_cache – Allow returning feature views from the cached registry

Returns:

List of project metadata

list_request_feature_views(project: str, allow_cache: bool = False) List[RequestFeatureView][source]

Retrieve a list of request feature views from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

list_saved_datasets(project: str, allow_cache: bool = False) List[SavedDataset][source]

Retrieves a list of all saved datasets in specified project

Parameters:
  • project – Feast project

  • allow_cache – Whether to allow returning this dataset from a cached registry

Returns:

Returns the list of SavedDatasets

list_stream_feature_views(project: str, allow_cache: bool = False) List[StreamFeatureView][source]

Retrieve a list of stream feature views from the registry

Parameters:
  • project – Filter stream feature views based on project name

  • allow_cache – Whether to allow returning stream feature views from a cached registry

Returns:

List of stream feature views

list_validation_references(project: str, allow_cache: bool = False) List[ValidationReference][source]

Retrieve a list of validation references from the registry

Parameters:
  • allow_cache – Allow returning feature views from the cached registry

  • project – Filter feature views based on project name

Returns:

List of request feature views

proto() Registry[source]

Retrieves a proto version of the registry.

Returns:

The registry proto object.

refresh(project: str | None = None)[source]

Refreshes the state of the registry cache by fetching the registry state from the remote registry store.

teardown()[source]
update_infra(infra: Infra, project: str, commit: bool = True)[source]

Updates the stored Infra object.

Parameters:
  • infra – The new Infra object to be stored.

  • project – Feast project that the Infra object refers to

  • commit – Whether the change should be persisted immediately

Module contents