MCPcopy
hub / github.com/feast-dev/feast / get_feature_view_by_name

Method get_feature_view_by_name

sdk/python/feast/offline_server.py:177–212  ·  view source on GitHub ↗

Retrieves a feature view by name, including all subclasses of FeatureView. Args: fv_name: Name of feature view name_alias: Alias to be applied to the projection of the registered view project: Feast project that this feature view belongs to

(
        self, fv_name: str, name_alias: str, project: str
    )

Source from the content-addressed store, hash-verified

175 del self.flights[key]
176
177 def get_feature_view_by_name(
178 self, fv_name: str, name_alias: str, project: str
179 ) -> FeatureView:
180 """
181 Retrieves a feature view by name, including all subclasses of FeatureView.
182
183 Args:
184 fv_name: Name of feature view
185 name_alias: Alias to be applied to the projection of the registered view
186 project: Feast project that this feature view belongs to
187
188 Returns:
189 Returns either the specified feature view, or raises an exception if
190 none is found
191 """
192 try:
193 fv = self.store.registry.get_feature_view(name=fv_name, project=project)
194 if name_alias is not None:
195 for fs in self.store.registry.list_feature_services(project=project):
196 for p in fs.feature_view_projections:
197 if p.name_alias == name_alias:
198 logger.debug(
199 f"Found matching FeatureService {fs.name} with projection {p}"
200 )
201 fv = fv.with_projection(p)
202 return fv
203 except FeatureViewNotFoundException:
204 try:
205 return self.store.registry.get_stream_feature_view(
206 name=fv_name, project=project
207 )
208 except Exception as e:
209 logger.error(
210 f"Cannot find any FeatureView by name {fv_name} in project {project}"
211 )
212 raise e
213
214 def list_feature_views_by_name(
215 self, feature_view_names: List[str], name_aliases: List[str], project: str

Calls 5

with_projectionMethod · 0.80
get_feature_viewMethod · 0.45
list_feature_servicesMethod · 0.45
errorMethod · 0.45