-
Notifications
You must be signed in to change notification settings - Fork 1.3k
check_conflicting_feature_view_names falsely flags cross-project name conflicts in shared registries #6209
Description
Summary
In the file-based Registry (sdk/python/feast/infra/registry/registry.py), _check_conflicting_feature_view_names builds a lookup map keyed by feature view name only, without scoping by project. In a shared registry with multiple projects, this causes false ConflictingFeatureViewNames errors when two different projects define feature views with the same name but of different types (e.g., a FeatureView in project A and a StreamFeatureView in project B).
Problem
The helper _existing_feature_view_names_to_fvs iterates over all feature views, stream feature views, and on-demand feature views in the entire RegistryProto and builds a dict keyed by fv.spec.name:
def _existing_feature_view_names_to_fvs(self) -> dict[str, Message]:
fvs = {}
for fv in self.cached_registry_proto.feature_views:
fvs[fv.spec.name] = fv # no project filter
for sfv in self.cached_registry_proto.stream_feature_views:
fvs[sfv.spec.name] = sfv # no project filter
for odfv in self.cached_registry_proto.on_demand_feature_views:
fvs[odfv.spec.name] = odfv # no project filter
return fvs
_check_conflicting_feature_view_names then uses this map to detect type conflicts. Since the map is not scoped by project, a FeatureView named my_view in project_a and a StreamFeatureView named my_view in project_b will collide in the dict, and applying either one can raise a spurious ConflictingFeatureViewNames error.
Reproduction
- Configure a shared file-based registry for two projects (project_a and project_b).
- In project_a, define a FeatureView named driver_stats.
- In project_b, define a StreamFeatureView also named driver_stats.
- Run feast apply for project_b — it raises ConflictingFeatureViewNames even though the two feature views belong to different projects and should not conflict.
Expected behavior
The name-to-feature-view map should be scoped to the current project so that names from other projects are excluded from the conflict check:
for fv in self.cached_registry_proto.feature_views:
if fv.spec.project == project:
fvs[fv.spec.name] = fv
Impact
- Prevents legitimate multi-project deployments from using the same feature view names across projects in a shared registry.
- Only affects the file-based registry (registry.py). The SQL and Snowflake registries perform conflict detection differently.