Skip to content

Commit b65ed4b

Browse files
tokokoHaoXuAI
authored andcommitted
feat: Add python client for remote registry server (#3941)
* add remote registry Signed-off-by: tokoko <togurg14@freeuni.edu.ge> * format and lint remote registry code Signed-off-by: tokoko <togurg14@freeuni.edu.ge> * add read-only registry exception Signed-off-by: tokoko <togurg14@freeuni.edu.ge> --------- Signed-off-by: tokoko <togurg14@freeuni.edu.ge>
1 parent 0d4860b commit b65ed4b

File tree

7 files changed

+454
-1
lines changed

7 files changed

+454
-1
lines changed

sdk/python/feast/errors.py

+5
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

+4
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

+1-1
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

+4
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)