Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add list validation references
Signed-off-by: Amom Mendes <[email protected]>
  • Loading branch information
amommendes committed Jan 7, 2023
commit ba4df5cafa904e4a6fdacb2f1db064d4e8a9d67c
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/registry/proto_registry_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def get_validation_reference(
return ValidationReference.from_proto(validation_reference)
raise ValidationReferenceNotFound(name, project=project)

def list_validation_references(
registry_proto: RegistryProto
):
return registry_proto.validation_references

def list_feature_services(
registry_proto: RegistryProto, project: str, allow_cache: bool = False
Expand Down
10 changes: 10 additions & 0 deletions sdk/python/feast/infra/registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,16 @@ def get_validation_reference(
registry_proto, name, project
)

def list_validation_references(
self, project: str, allow_cache: bool = False
) -> List[ValidationReference]:
registry_proto = self._get_registry_proto(
project=project, allow_cache=allow_cache
)
return proto_registry_utils.list_validation_references(
registry_proto
)

def delete_validation_reference(self, name: str, project: str, commit: bool = True):
registry_proto = self._prepare_registry_for_changes(project)
for idx, existing_validation_reference in enumerate(
Expand Down
16 changes: 16 additions & 0 deletions sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,22 @@ def get_validation_reference(
not_found_exception=ValidationReferenceNotFound,
)

def list_validation_references(
self, project: str, allow_cache: bool = False
) -> List[ValidationReference]:
if allow_cache:
self._refresh_cached_registry_if_necessary()
return proto_registry_utils.list_validation_references(
self.cached_registry_proto
)
return self._list_objects(
table=validation_references,
project=project,
proto_class=ValidationReferenceProto,
python_class=ValidationReference,
proto_field_name="validation_reference_proto"
)

def list_entities(self, project: str, allow_cache: bool = False) -> List[Entity]:
if allow_cache:
self._refresh_cached_registry_if_necessary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_e2e_local() -> None:
"""
Tests the end-to-end workflow of apply, materialize, and online retrieval.

This test runs against several different types of repos:
This test runs against several types of repos:
1. A repo with a normal FV and an entity-less FV.
2. A repo using the SDK from version 0.19.0.
3. A repo with a FV with a ttl of 0.
Expand Down