Skip to content

Commit 42a7b81

Browse files
authored
feat: Add python client for remote registry server (#3941)
* add remote registry Signed-off-by: tokoko <[email protected]> * format and lint remote registry code Signed-off-by: tokoko <[email protected]> * add read-only registry exception Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]>
1 parent fa8492d commit 42a7b81

7 files changed

Lines changed: 454 additions & 1 deletion

File tree

‎sdk/python/feast/errors.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,8 @@ def __init__(self):
415415
class PushSourceNotFoundException(Exception):
416416
def __init__(self, push_source_name: str):
417417
super().__init__(f"Unable to find push source '{push_source_name}'.")
418+
419+
420+
class ReadOnlyRegistryException(Exception):
421+
def __init__(self):
422+
super().__init__("Registry implementation is read-only.")

‎sdk/python/feast/feature_store.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ def __init__(
164164
self._registry = SnowflakeRegistry(
165165
registry_config, self.config.project, None
166166
)
167+
elif registry_config and registry_config.registry_type == "remote":
168+
from feast.infra.registry.remote import RemoteRegistry
169+
170+
self._registry = RemoteRegistry(registry_config, self.config.project, None)
167171
else:
168172
r = Registry(self.config.project, registry_config, repo_path=self.repo_path)
169173
r._initialize_registry(self.config.project)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True):
246246
@abstractmethod
247247
def get_stream_feature_view(
248248
self, name: str, project: str, allow_cache: bool = False
249-
):
249+
) -> StreamFeatureView:
250250
"""
251251
Retrieves a stream feature view.
252252

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def __new__(
178178
from feast.infra.registry.snowflake import SnowflakeRegistry
179179

180180
return SnowflakeRegistry(registry_config, project, repo_path)
181+
elif registry_config and registry_config.registry_type == "remote":
182+
from feast.infra.registry.remote import RemoteRegistry
183+
184+
return RemoteRegistry(registry_config, project, repo_path)
181185
else:
182186
return super(Registry, cls).__new__(cls)
183187

0 commit comments

Comments
 (0)