Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add python client for remote registry server #3941

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions sdk/python/feast/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,8 @@ def __init__(self):
class PushSourceNotFoundException(Exception):
def __init__(self, push_source_name: str):
super().__init__(f"Unable to find push source '{push_source_name}'.")


class ReadOnlyRegistryException(Exception):
def __init__(self):
super().__init__("Registry implementation is read-only.")
4 changes: 4 additions & 0 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def __init__(
self._registry = SnowflakeRegistry(
registry_config, self.config.project, None
)
elif registry_config and registry_config.registry_type == "remote":
from feast.infra.registry.remote import RemoteRegistry

self._registry = RemoteRegistry(registry_config, self.config.project, None)
else:
r = Registry(self.config.project, registry_config, repo_path=self.repo_path)
r._initialize_registry(self.config.project)
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/registry/base_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True):
@abstractmethod
def get_stream_feature_view(
self, name: str, project: str, allow_cache: bool = False
):
) -> StreamFeatureView:
"""
Retrieves a stream feature view.

Expand Down
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def __new__(
from feast.infra.registry.snowflake import SnowflakeRegistry

return SnowflakeRegistry(registry_config, project, repo_path)
elif registry_config and registry_config.registry_type == "remote":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from this point I felt like the Registry is more like a common class instead of a file registry?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, confused me a lot as well. It probably used to be the common one, but then another base class was added and now it's a bit jumbled.

from feast.infra.registry.remote import RemoteRegistry

return RemoteRegistry(registry_config, project, repo_path)
else:
return super(Registry, cls).__new__(cls)

Expand Down
Loading
Loading