GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Extend `get_feature_view` to return stream and on demand feature views by tokoko · Pull Request #4328 · feast-dev/feast

Conversation

@tokoko

@tokoko tokoko commented Jul 2, 2024

Copy link
Copy Markdown
Collaborator

Which issue(s) this PR fixes:

  • Fixes Registry get_feature_view should read stream and on-demand feature views #4235

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tokoko
extend get_feature_view to return stream and on demand views
1d923f3
Signed-off-by: tokoko <[email protected]>
@tokoko tokoko added the ok-to-test label Jul 2, 2024
@tokoko

tokoko commented Jul 2, 2024

Copy link
Copy Markdown
Collaborator Author

@dmartinol Ended up having to make changes all over. Maybe you can find time to look through.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tokoko tokoko mentioned this pull request Jul 2, 2024
Added permission assert check for registry server, offline server, online server functions RHEcosystemAppEng/feast#25
Merged
dmartinol
dmartinol reviewed Jul 3, 2024
View reviewed changes

@dmartinol dmartinol left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm.
I just see a lot of assert isinstance(fv, FeatureView) that I hope are all correct as some of them, like the OnDemandFV, are only BaseFV instead. I cannot follow the complete flow, but I trust you 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tokoko

tokoko commented Jul 3, 2024

Copy link
Copy Markdown
Collaborator Author

That's mostly to accommodate the linter for now, I should probably add more feast-specific exceptions (for example if a user is asking to materialize an odfv, which doesn't make sense)

On a general note, I found that we have a following trade-off here:

  • When get_feature_view returns all types a lot of most common operations become cleaner to implement, for example when a user is passing a list of fv names that might be any one of them, we no longer need crazy exception handling to figure out which method to call.
  • In some other less common cases when only a single fv type makes sense, we will now have to check the type of the object returned, we can no longer rely on the fact that registry method used would do that for us. When we drop py3.9, we should probably start using python match statements for this.

Despite the trade-off, I still think it's a worthwhile change. Still wanted to get your opinion.

dmartinol reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmartinol
dmartinol reviewed Jul 3, 2024
View reviewed changes
Comment thread sdk/python/feast/feature_store.py
)
if hide_dummy_entity and feature_view.entities[0] == DUMMY_ENTITY_NAME:
if (
isinstance(feature_view, FeatureView)

@dmartinol dmartinol Jul 3, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

utils._list_feature_views has a similar logic but misses the isinstance check, don't we need it there too?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tokoko tokoko Jul 3, 2024

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Not yet, it's using list_feature_views to get the objects which is still FeatureView specific, this PR only makes changes to get_feature_view. I'll do that in a follow-up.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dmartinol
dmartinol reviewed Jul 3, 2024
View reviewed changes
Comment thread sdk/python/feast/infra/registry/proto_registry_utils.py
on_demand_feature_view.spec.project == project
and on_demand_feature_view.spec.name == name
):
return OnDemandFeatureView.from_proto(on_demand_feature_view)

@dmartinol dmartinol Jul 3, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

the method is declared to return a FeatureView, isn't the linter complaining about that?
I think the reason is that OnDemandFeatureView.from_proto does not declare the retuned type 😉

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tokoko reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dmartinol

dmartinol commented Jul 3, 2024

Copy link
Copy Markdown
Contributor
  • In some other less common cases when only a single fv type makes sense, we will now have to check the type of the object returned, we can no longer rely on the fact that registry method used would do that for us. When we drop py3.9, we should probably start using python match statements for

It we really have this need, can't we apply an optional filter to return only instances of the requested type with no need to further check?
Really pseudo-code:

fv :  StreamFeatureView = fs.get_feature_view(name=..., accept_type=StreamFeatureView)
...

fvs: list[StreamFeatureView] = fs.list_feature_views(...,  accept_type=StreamFeatureView)
for fv in fvs:
    ...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tokoko

tokoko commented Jul 3, 2024

Copy link
Copy Markdown
Collaborator Author

It we really have this need, can't we apply an optional filter to return only instances of the requested type with no need to further check?

Let me look into this. This is actually probably a better idea since we'll definitely need something like this for list_feature_views method anyway, so why not here as well? I was just trying to keep the interface simple, because of the chain of changes this causes in registry server and so on.

P.S. I'm afraid linter issues won't go away even in this case. type annotation will have to be BaseFeatureView and some asserts here and there will be necessary.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dmartinol

dmartinol commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

P.S. I'm afraid linter issues won't go away even in this case. type annotation will have to be BaseFeatureView and some asserts here and there will be necessary.

Can't we surround it by cast? (asserts of accept_type can be hidden in the methods for all the clients):

fv :  StreamFeatureView = cast(StreamFeatureView, fs.get_feature_view(name=..., accept_type=StreamFeatureView))
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tokoko
tokoko marked this pull request as draft July 3, 2024 17:38
@dmartinol dmartinol mentioned this pull request Jul 30, 2024
Test Permission CRUD RHEcosystemAppEng/feast#56
Merged
@tokoko tokoko mentioned this pull request Aug 22, 2024
feat: Add registry methods for dealing with all FV types #4435
Merged
@tokoko tokoko closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dmartinol dmartinol dmartinol left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ok-to-test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Registry get_feature_view should read stream and on-demand feature views

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tokoko @dmartinol
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.