-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Check duplicate names for feature view across types #5999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6e256b6
e319a6f
be0e8a3
8363cd4
d7bac33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Prathap P <436prathap@gmail.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,8 +27,6 @@ | |
| from feast.errors import ( | ||
| ConflictingFeatureViewNames, | ||
| FeatureViewNotFoundException, | ||
| OnDemandFeatureViewNotFoundException, | ||
| StreamFeatureViewNotFoundException, | ||
| ) | ||
| from feast.feature_service import FeatureService | ||
| from feast.feature_view import FeatureView | ||
|
|
@@ -293,24 +291,25 @@ def _check_conflict(getter, not_found_exc, existing_type: str): | |
| pass | ||
|
|
||
| # Check StreamFeatureView before FeatureView since StreamFeatureView is a subclass | ||
| # Note: All getters raise FeatureViewNotFoundException (not type-specific exceptions) | ||
| if isinstance(feature_view, StreamFeatureView): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HaoXuAI
Currently, the cache util doesn’t have an 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:
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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HaoXuAI I can go ahead to implement, if you find we are good with above logic 😄
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think that makes sense. Feel free to create a new issue for this. We can go with the current solution for now |
||
| _check_conflict( | ||
| self.get_feature_view, FeatureViewNotFoundException, "FeatureView" | ||
| ) | ||
| _check_conflict( | ||
| self.get_on_demand_feature_view, | ||
| OnDemandFeatureViewNotFoundException, | ||
| FeatureViewNotFoundException, | ||
| "OnDemandFeatureView", | ||
| ) | ||
| elif isinstance(feature_view, FeatureView): | ||
| _check_conflict( | ||
| self.get_stream_feature_view, | ||
| StreamFeatureViewNotFoundException, | ||
| FeatureViewNotFoundException, | ||
| "StreamFeatureView", | ||
| ) | ||
| _check_conflict( | ||
| self.get_on_demand_feature_view, | ||
| OnDemandFeatureViewNotFoundException, | ||
| FeatureViewNotFoundException, | ||
| "OnDemandFeatureView", | ||
| ) | ||
| elif isinstance(feature_view, OnDemandFeatureView): | ||
|
|
@@ -319,7 +318,7 @@ def _check_conflict(getter, not_found_exc, existing_type: str): | |
| ) | ||
| _check_conflict( | ||
| self.get_stream_feature_view, | ||
| StreamFeatureViewNotFoundException, | ||
| FeatureViewNotFoundException, | ||
| "StreamFeatureView", | ||
| ) | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.