Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
add read-only registry exception
Signed-off-by: tokoko <togurg14@freeuni.edu.ge>
  • Loading branch information
tokoko committed Feb 18, 2024
commit 5cbf440ac8d3443d333471a31c2eab3d6fac40cf
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.")
31 changes: 16 additions & 15 deletions sdk/python/feast/infra/registry/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from feast.base_feature_view import BaseFeatureView
from feast.data_source import DataSource
from feast.entity import Entity
from feast.errors import ReadOnlyRegistryException
from feast.feature_service import FeatureService
from feast.feature_view import FeatureView
from feast.infra.infra_object import Infra
Expand Down Expand Up @@ -43,10 +44,10 @@ def __init__(
self.stub = RegistryServer_pb2_grpc.RegistryServerStub(self.channel)

def apply_entity(self, entity: Entity, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_entity(self, name: str, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_entity(self, name: str, project: str, allow_cache: bool = False) -> Entity:
request = RegistryServer_pb2.GetEntityRequest(
Expand All @@ -69,10 +70,10 @@ def list_entities(self, project: str, allow_cache: bool = False) -> List[Entity]
def apply_data_source(
self, data_source: DataSource, project: str, commit: bool = True
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_data_source(self, name: str, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_data_source(
self, name: str, project: str, allow_cache: bool = False
Expand Down Expand Up @@ -101,10 +102,10 @@ def list_data_sources(
def apply_feature_service(
self, feature_service: FeatureService, project: str, commit: bool = True
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_feature_service(self, name: str, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_feature_service(
self, name: str, project: str, allow_cache: bool = False
Expand Down Expand Up @@ -134,10 +135,10 @@ def list_feature_services(
def apply_feature_view(
self, feature_view: BaseFeatureView, project: str, commit: bool = True
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_feature_view(self, name: str, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_stream_feature_view(
self, name: str, project: str, allow_cache: bool = False
Expand Down Expand Up @@ -247,18 +248,18 @@ def apply_materialization(
end_date: datetime,
commit: bool = True,
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def apply_saved_dataset(
self,
saved_dataset: SavedDataset,
project: str,
commit: bool = True,
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_saved_dataset(self, name: str, project: str, allow_cache: bool = False):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_saved_dataset(
self, name: str, project: str, allow_cache: bool = False
Expand Down Expand Up @@ -291,10 +292,10 @@ def apply_validation_reference(
project: str,
commit: bool = True,
):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def delete_validation_reference(self, name: str, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_validation_reference(
self, name: str, project: str, allow_cache: bool = False
Expand Down Expand Up @@ -333,7 +334,7 @@ def list_project_metadata(
return [ProjectMetadata.from_proto(pm) for pm in response.project_metadata]

def update_infra(self, infra: Infra, project: str, commit: bool = True):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def get_infra(self, project: str, allow_cache: bool = False) -> Infra:
request = RegistryServer_pb2.GetInfraRequest(
Expand Down Expand Up @@ -361,7 +362,7 @@ def proto(self) -> RegistryProto:
return self.stub.Proto(Empty())

def commit(self):
raise Exception("Unimplemented: remote registry is read-only")
raise ReadOnlyRegistryException()

def refresh(self, project: Optional[str] = None):
request = RegistryServer_pb2.RefreshRequest(project=str(project))
Expand Down