Skip to content

Commit

Permalink
feat: Adding list_validation_references for default and sql registry (#…
Browse files Browse the repository at this point in the history
…3436)

* Adding description as a first-class attribute for features/fields

Signed-off-by: Amom Mendes <amommendes@hotmail.com>

* Formatting

Signed-off-by: Amom Mendes <amommendes@hotmail.com>

* Add list validation references

Signed-off-by: Amom Mendes <amommendes@hotmail.com>

* Format

Signed-off-by: Amom Mendes <amommendes@hotmail.com>

Signed-off-by: Amom Mendes <amommendes@hotmail.com>
  • Loading branch information
amommendes authored Jan 8, 2023
1 parent 753d8db commit 21dd253
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
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 @@ -116,6 +116,10 @@ def get_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
) -> List[FeatureService]:
Expand Down
8 changes: 8 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,14 @@ 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
2 changes: 1 addition & 1 deletion sdk/python/tests/unit/local_feast_tests/test_e2e_local.py
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

0 comments on commit 21dd253

Please sign in to comment.