Skip to content

Commit a2a0e29

Browse files
committed
use FeatureViewNotFoundException for all types as per Devin's suggestion
Signed-off-by: Prathap P <436prathap@gmail.com>
1 parent c299a71 commit a2a0e29

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

sdk/python/feast/errors.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ def __init__(self, name, project=None):
138138
super().__init__(f"On demand feature view {name} does not exist")
139139

140140

141-
class StreamFeatureViewNotFoundException(FeastObjectNotFoundException):
142-
def __init__(self, name, project=None):
143-
if project:
144-
super().__init__(
145-
f"Stream feature view {name} does not exist in project {project}"
146-
)
147-
else:
148-
super().__init__(f"Stream feature view {name} does not exist")
149-
150-
151141
class RequestDataNotFoundInEntityDfException(FeastObjectNotFoundException):
152142
def __init__(self, feature_name, feature_view_name):
153143
super().__init__(

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
from feast.errors import (
2828
ConflictingFeatureViewNames,
2929
FeatureViewNotFoundException,
30-
OnDemandFeatureViewNotFoundException,
31-
StreamFeatureViewNotFoundException,
3230
)
3331
from feast.feature_service import FeatureService
3432
from feast.feature_view import FeatureView
@@ -293,24 +291,25 @@ def _check_conflict(getter, not_found_exc, existing_type: str):
293291
pass
294292

295293
# Check StreamFeatureView before FeatureView since StreamFeatureView is a subclass
294+
# Note: All getters raise FeatureViewNotFoundException (not type-specific exceptions)
296295
if isinstance(feature_view, StreamFeatureView):
297296
_check_conflict(
298297
self.get_feature_view, FeatureViewNotFoundException, "FeatureView"
299298
)
300299
_check_conflict(
301300
self.get_on_demand_feature_view,
302-
OnDemandFeatureViewNotFoundException,
301+
FeatureViewNotFoundException,
303302
"OnDemandFeatureView",
304303
)
305304
elif isinstance(feature_view, FeatureView):
306305
_check_conflict(
307306
self.get_stream_feature_view,
308-
StreamFeatureViewNotFoundException,
307+
FeatureViewNotFoundException,
309308
"StreamFeatureView",
310309
)
311310
_check_conflict(
312311
self.get_on_demand_feature_view,
313-
OnDemandFeatureViewNotFoundException,
312+
FeatureViewNotFoundException,
314313
"OnDemandFeatureView",
315314
)
316315
elif isinstance(feature_view, OnDemandFeatureView):
@@ -319,7 +318,7 @@ def _check_conflict(getter, not_found_exc, existing_type: str):
319318
)
320319
_check_conflict(
321320
self.get_stream_feature_view,
322-
StreamFeatureViewNotFoundException,
321+
FeatureViewNotFoundException,
323322
"StreamFeatureView",
324323
)
325324

0 commit comments

Comments
 (0)