Implement entity aliasing for feature retrieval - #1868
Conversation
There was a problem hiding this comment.
Is use_time a term people use? It wasn't immediately clear to me what this meant. I was also imagining that the logic for manipulating the feature view would be on the feature view itself, not a separate method.
Finally, you should add type annotations please.
There was a problem hiding this comment.
-
Definitely open to alternatives of
use_time- I agree that it's not clear, but I'm not sure how else to describe it or what to rename it to. Basically instead of grabbing all of the registeredFeatureViews, we need to grab any changes that the user wants to specify at the time of using the FeatureView (like thejoin_key_mapor a new name). -
By "the logic for manipulating the feature view would be on the feature view itself", do you mean
.override_join_keysor.with_join_key_mapshould manipulate the original object? I feel like we wouldn't want that behavior with this design given one might use it multiple times in different contexts. -
Will do in next commit 👌
There was a problem hiding this comment.
Definitely open to alternatives of use_time - I agree that it's not clear, but I'm not sure how else to describe it or what to rename it to. Basically instead of grabbing all of the registered FeatureViews, we need to grab any changes that the user wants to specify at the time of using the FeatureView (like the join_key_map or a new name).
I'd first want to see if we can avoid naming it at all. My instinct would have been to use a class like FeatureViewProjection which already supports filtering columns, and adding more options like renaming the feature view or overriding the join key. We may change it over time to be FeatureViewQuery or something. That would also prevent somebody from doing fv.with_name("blah") and then accidentally registering that FV, since we only anticipate the use of renaming to be for queries.
By "the logic for manipulating the feature view would be on the feature view itself", do you mean .override_join_keys or .with_join_key_map should manipulate the original object? I feel like we wouldn't want that behavior with this design given one might use it multiple times in different contexts.
Not override the original object, but instead produce a new object. It's just that the logic itself seems like it is better to have on the feature view class itself, basically what @mavysavydav did with with_name(). Although in his case he is returning a FV, but I think we may want to return another object that is specifically used for queries.
|
Please remember to add documentation to this PR as well. |
There was a problem hiding this comment.
shoot, just realized these are all FeatureViewProjection objects cause it converts the features after initializing a FeatureService...
There was a problem hiding this comment.
This is dependent on a PR by @mavysavydav to have FeatureService.features allow FeatureView as one of the types.
fc37021 to
2e8e445
Compare
Codecov Report
@@ Coverage Diff @@
## master #1868 +/- ##
==========================================
+ Coverage 82.02% 82.26% +0.24%
==========================================
Files 96 96
Lines 7576 7669 +93
==========================================
+ Hits 6214 6309 +95
+ Misses 1362 1360 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
2272583 to
78ac430
Compare
|
/ok-to-test |
Signed-off-by: Cody Lin <codyl@twitter.com>
|
/retest |
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: David Y Liu <davidyliuliu@gmail.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
28d9c3b to
ed46f51
Compare
Signed-off-by: Cody Lin <codyl@twitter.com>
|
looks mostly good, looking at the integ test code which was a bit more involved |
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
Signed-off-by: Cody Lin <codyl@twitter.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: achals, codyjlin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Cody Lin codyl@twitter.com
What this PR does / why we need it:
This PR implements the Shadow Entities Mapping RFC - currently assuming we go with Option 8b (and the implementation idea at the bottom of the RFC). It will allow a user to override a FeatureView's join_key (like
"user_id") to be able to join with anentity_dfsource that might have other column names that are spelled differently or might be "subclasses" of the entity (like"spammer_id"and"reporter_id"). This functionality is to be made available on the offline side viaget_historical_featuresand the online side viaget_online_features.TODO:
Which issue(s) this PR fixes:
Part of #1762
(Might want to add documentation after change is landed)
Does this PR introduce a user-facing change?: