Skip to content

Comments

fix: Check duplicate names for feature view across types#5999

Open
Prathap-P wants to merge 5 commits intofeast-dev:masterfrom
Prathap-P:featureview_name_collision
Open

fix: Check duplicate names for feature view across types#5999
Prathap-P wants to merge 5 commits intofeast-dev:masterfrom
Prathap-P:featureview_name_collision

Conversation

@Prathap-P
Copy link
Contributor

@Prathap-P Prathap-P commented Feb 21, 2026

What this PR does / why we need it:

  • This PR enforces cross-type feature view name uniqueness to fix a bug (Enforce unique feature view names across all feature view types during apply #5995).
  • Previously, get_online_features resolved feature view names via get_any_feature_view, which checks registry tables in a fixed order: FeatureView → StreamFeatureView → OnDemandFeatureView.
  • If a project registered both a FeatureView and StreamFeatureView with the same name, every get_online_features call would silently return the FeatureView, even when the StreamFeatureView contained fresher data

Which issue(s) this PR fixes:

Fixes #5995

Misc


Open with Devin

@Prathap-P Prathap-P requested a review from a team as a code owner February 21, 2026 12:10
devin-ai-integration[bot]

This comment was marked as resolved.

Signed-off-by: Prathap P <436prathap@gmail.com>
@Prathap-P Prathap-P force-pushed the featureview_name_collision branch 3 times, most recently from f23ff7b to 77cc24c Compare February 21, 2026 13:18
Signed-off-by: Prathap P <436prathap@gmail.com>
@Prathap-P Prathap-P force-pushed the featureview_name_collision branch from 77cc24c to c299a71 Compare February 21, 2026 13:19
@Prathap-P Prathap-P changed the title check duplicate names for feature view across types fix: check duplicate names for feature view across types Feb 21, 2026
@Prathap-P Prathap-P changed the title fix: check duplicate names for feature view across types fix: Check duplicate names for feature view across types Feb 21, 2026

# Check StreamFeatureView before FeatureView since StreamFeatureView is a subclass
# Note: All getters raise FeatureViewNotFoundException (not type-specific exceptions)
if isinstance(feature_view, StreamFeatureView):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean it will call to retrieve feature view many times? Can we optimize it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, you're concerned that when creating 100 feature views, the apply_feature_view function calls the getters for the other two types each time. That results in 2 database calls per feature view — 200 total — and you’re wondering if we should optimize this part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HaoXuAI
I have a plan. We need to validate in two places:

  1. In the incoming request — ensure the new feature view name doesn’t exist in the other two types within the request (and vice versa).
  2. In the database — check against existing records (for the SQL registry case).

Currently, the cache util doesn’t have an exists function to check if a name is already in the registry. Even if it did, calling it 100 times wouldn’t be efficient.

So I’m planning to create a util function per feature view type that takes a list of names and a project, and checks that none of the names exist in the DB.

For example, if 50 feature views come in:

  • I’ll call the new util once with those 50 names against the stream and on-demand tables.
  • Do the same vice versa for the other types.

This way, instead of calling per feature view, we make only two DB calls per type.

That’s my current idea. Do you see any better optimization?

@Prathap-P Prathap-P requested a review from HaoXuAI February 24, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce unique feature view names across all feature view types during apply

2 participants