@@ -344,18 +344,26 @@ async def push(request: PushFeaturesRequest) -> None:
344344 async def _get_feast_object (
345345 feature_view_name : str , allow_registry_cache : bool
346346 ) -> FeastObject :
347- try :
348- return await run_in_threadpool (
349- store .get_stream_feature_view ,
350- feature_view_name ,
351- allow_registry_cache = allow_registry_cache ,
352- )
353- except FeatureViewNotFoundException :
354- return await run_in_threadpool (
355- store .get_feature_view ,
356- feature_view_name ,
357- allow_registry_cache = allow_registry_cache ,
358- )
347+ # FIXME: this logic repeated at least 3 times in the codebase - should be centralized
348+ # in logging, in server and in feature_store (Python SDK)
349+ potential_sources = [
350+ store .get_feature_view ,
351+ store .get_on_demand_feature_view ,
352+ store .get_stream_feature_view ,
353+ ]
354+
355+ for source in potential_sources :
356+ try :
357+ return await run_in_threadpool (
358+ source ,
359+ feature_view_name ,
360+ allow_registry_cache = allow_registry_cache ,
361+ )
362+ except FeatureViewNotFoundException :
363+ continue
364+
365+ # By this point, none of the sources found the feature view
366+ raise FeatureViewNotFoundException (feature_view_name )
359367
360368 @app .post ("/write-to-online-store" , dependencies = [Depends (inject_user_details )])
361369 async def write_to_online_store (request : WriteToFeatureStoreRequest ) -> None :
0 commit comments