Problem
In the Feast Python SDK, get_online_features resolves feature view names through _get_any_feature_view, which checks the registry tables in a fixed order:
- Regular
FeatureView
OnDemandFeatureView
StreamFeatureView
This means if a project registers both a regular FeatureView and a StreamFeatureView (or OnDemandFeatureView) sharing the same name, get_online_features will always return the regular feature view — even if the stream view is the one producing the freshest data.
Relevant code
SqlRegistry._get_any_feature_view (sql.py#L374-L409):
def _get_any_feature_view(self, name: str, project: str) -> BaseFeatureView:
fv = self._get_object(table=feature_views, ...)
if not fv:
fv = self._get_object(table=on_demand_feature_views, ...)
if not fv:
fv = self._get_object(table=stream_feature_views, ...)
return fv
proto_registry_utils.get_any_feature_view follows the same fixed-order pattern for the cached registry path.
Same pattern in FeatureStore.apply
During apply, the different feature view types are separated into independent lists (views_to_update, sfvs_to_update, odfvs_to_update) and applied independently — there is no cross-type uniqueness check on names.
Expected Behavior
feast apply should fail with a clear error if a feature view name collides across different feature view types (e.g., a FeatureView and a StreamFeatureView sharing the same name). This would prevent silent, hard-to-debug issues at serving time.
Proposed Solution
Add a validation step in FeatureStore.apply() (or _validate_feature_views) that collects all feature view names across FeatureView, OnDemandFeatureView, and StreamFeatureView, and raises a ValueError if any duplicates are found.
Implementation guidance
-
Where to add the check: In FeatureStore.apply() (feature_store.py#L770), after the objects are separated into views_to_update, sfvs_to_update, and odfvs_to_update (around line 849), add a cross-type name uniqueness validation.
-
What the check should do:
- Collect all names from
views_to_update, sfvs_to_update, and odfvs_to_update
- Detect any duplicate names across these lists
- Raise a clear
ValueError listing the duplicated name(s) and which types collide
-
Alternatively or additionally, the _validate_feature_views method (feature_store.py#L560-L579) could be extended to include this cross-type check.
-
Tests: Add unit tests that verify apply raises an error when feature views of different types share the same name.
References
- Discussed in Feast Slack #feast-beginners: thread
Problem
In the Feast Python SDK,
get_online_featuresresolves feature view names through_get_any_feature_view, which checks the registry tables in a fixed order:FeatureViewOnDemandFeatureViewStreamFeatureViewThis means if a project registers both a regular
FeatureViewand aStreamFeatureView(orOnDemandFeatureView) sharing the same name,get_online_featureswill always return the regular feature view — even if the stream view is the one producing the freshest data.Relevant code
SqlRegistry._get_any_feature_view(sql.py#L374-L409):proto_registry_utils.get_any_feature_viewfollows the same fixed-order pattern for the cached registry path.Same pattern in
FeatureStore.applyDuring
apply, the different feature view types are separated into independent lists (views_to_update,sfvs_to_update,odfvs_to_update) and applied independently — there is no cross-type uniqueness check on names.Expected Behavior
feast applyshould fail with a clear error if a feature view name collides across different feature view types (e.g., aFeatureViewand aStreamFeatureViewsharing the same name). This would prevent silent, hard-to-debug issues at serving time.Proposed Solution
Add a validation step in
FeatureStore.apply()(or_validate_feature_views) that collects all feature view names acrossFeatureView,OnDemandFeatureView, andStreamFeatureView, and raises aValueErrorif any duplicates are found.Implementation guidance
Where to add the check: In
FeatureStore.apply()(feature_store.py#L770), after the objects are separated intoviews_to_update,sfvs_to_update, andodfvs_to_update(around line 849), add a cross-type name uniqueness validation.What the check should do:
views_to_update,sfvs_to_update, andodfvs_to_updateValueErrorlisting the duplicated name(s) and which types collideAlternatively or additionally, the
_validate_feature_viewsmethod (feature_store.py#L560-L579) could be extended to include this cross-type check.Tests: Add unit tests that verify
applyraises an error when feature views of different types share the same name.References