Skip to content

Commit 21dd253

Browse files
authored
feat: Adding list_validation_references for default and sql registry (feast-dev#3436)
* Adding description as a first-class attribute for features/fields Signed-off-by: Amom Mendes <[email protected]> * Formatting Signed-off-by: Amom Mendes <[email protected]> * Add list validation references Signed-off-by: Amom Mendes <[email protected]> * Format Signed-off-by: Amom Mendes <[email protected]> Signed-off-by: Amom Mendes <[email protected]>
1 parent 753d8db commit 21dd253

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

sdk/python/feast/infra/registry/proto_registry_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ def get_validation_reference(
116116
raise ValidationReferenceNotFound(name, project=project)
117117

118118

119+
def list_validation_references(registry_proto: RegistryProto):
120+
return registry_proto.validation_references
121+
122+
119123
def list_feature_services(
120124
registry_proto: RegistryProto, project: str, allow_cache: bool = False
121125
) -> List[FeatureService]:

sdk/python/feast/infra/registry/registry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,14 @@ def get_validation_reference(
740740
registry_proto, name, project
741741
)
742742

743+
def list_validation_references(
744+
self, project: str, allow_cache: bool = False
745+
) -> List[ValidationReference]:
746+
registry_proto = self._get_registry_proto(
747+
project=project, allow_cache=allow_cache
748+
)
749+
return proto_registry_utils.list_validation_references(registry_proto)
750+
743751
def delete_validation_reference(self, name: str, project: str, commit: bool = True):
744752
registry_proto = self._prepare_registry_for_changes(project)
745753
for idx, existing_validation_reference in enumerate(

sdk/python/feast/infra/registry/sql.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,22 @@ def get_validation_reference(
408408
not_found_exception=ValidationReferenceNotFound,
409409
)
410410

411+
def list_validation_references(
412+
self, project: str, allow_cache: bool = False
413+
) -> List[ValidationReference]:
414+
if allow_cache:
415+
self._refresh_cached_registry_if_necessary()
416+
return proto_registry_utils.list_validation_references(
417+
self.cached_registry_proto
418+
)
419+
return self._list_objects(
420+
table=validation_references,
421+
project=project,
422+
proto_class=ValidationReferenceProto,
423+
python_class=ValidationReference,
424+
proto_field_name="validation_reference_proto",
425+
)
426+
411427
def list_entities(self, project: str, allow_cache: bool = False) -> List[Entity]:
412428
if allow_cache:
413429
self._refresh_cached_registry_if_necessary()

sdk/python/tests/unit/local_feast_tests/test_e2e_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_e2e_local() -> None:
2121
"""
2222
Tests the end-to-end workflow of apply, materialize, and online retrieval.
2323
24-
This test runs against several different types of repos:
24+
This test runs against several types of repos:
2525
1. A repo with a normal FV and an entity-less FV.
2626
2. A repo using the SDK from version 0.19.0.
2727
3. A repo with a FV with a ttl of 0.

0 commit comments

Comments
 (0)