Skip to content
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

Initial scaffolding for on demand feature view #1803

Merged
merged 6 commits into from
Sep 2, 2021

Conversation

adchia
Copy link
Collaborator

@adchia adchia commented Aug 25, 2021

What this PR does / why we need it:
Sets up initial storage and scaffolding for on demand feature view, and supports online fetching. This does not yet support offline feature fetching or request data.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Add support for row-level on-demand transformations of feature view features in get_online_features

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2021

Codecov Report

Merging #1803 (61c9f4d) into master (66cf6a4) will decrease coverage by 21.27%.
The diff coverage is 43.26%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1803       +/-   ##
===========================================
- Coverage   84.64%   63.37%   -21.28%     
===========================================
  Files          93       94        +1     
  Lines        6812     6946      +134     
===========================================
- Hits         5766     4402     -1364     
- Misses       1046     2544     +1498     
Flag Coverage Δ
integrationtests ?
unittests 63.37% <43.26%> (-0.41%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../integration/online_store/test_universal_online.py 19.04% <14.28%> (-80.96%) ⬇️
sdk/python/feast/repo_operations.py 44.44% <17.64%> (-1.82%) ⬇️
sdk/python/feast/registry.py 56.18% <39.39%> (-22.35%) ⬇️
sdk/python/feast/on_demand_feature_view.py 50.00% <50.00%> (ø)
sdk/python/feast/feature_store.py 87.53% <52.17%> (-5.11%) ⬇️
...tegration/feature_repos/universal/feature_views.py 57.89% <55.55%> (-42.11%) ⬇️
sdk/python/feast/errors.py 66.32% <66.66%> (-3.15%) ⬇️
sdk/python/feast/__init__.py 90.47% <100.00%> (+0.47%) ⬆️
.../integration/online_store/test_online_retrieval.py 17.39% <0.00%> (-82.61%) ⬇️
sdk/python/tests/utils/online_read_write_test.py 18.18% <0.00%> (-81.82%) ⬇️
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66cf6a4...61c9f4d. Read the comment docs.

Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

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

Generally looks great!

Comment on lines 777 to 795
for odfv in all_on_demand_feature_views:
feature_ref = odfv.name
if feature_ref in _feature_refs:
ret_value = odfv.udf.__call__(initial_response_df)
result_row.fields[odfv.name].CopyFrom(
ValueProto(double_val=ret_value[odfv.features[0].name].values[0])
)
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that we're invoking all the odfvs for every single get_online_features call? Assuming that that's just directional

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is that not the intended behavior of an "on demand" feature view? We wouldn't materialize this into an online store for example. That'd be what we'd include in a batch feature view.

There's a TODO right above it to only include the right fields from the specified FV, if that's what you're referring to

sdk/python/feast/registry.py Show resolved Hide resolved
protos/feast/core/OnDemandFeatureView.proto Show resolved Hide resolved
protos/feast/core/OnDemandFeatureView.proto Show resolved Hide resolved
sdk/python/feast/on_demand_feature_view.py Outdated Show resolved Hide resolved
@adchia adchia changed the title WIP: Initial scaffolding for on demand feature view Initial scaffolding for on demand feature view Aug 30, 2021
@adchia adchia removed request for tsotnet and woop August 31, 2021 17:18
@adchia adchia added the kind/feature New feature or request label Aug 31, 2021
…for transforms on online fetches

Signed-off-by: Danny Chiao <danny@tecton.ai>
Signed-off-by: Danny Chiao <danny@tecton.ai>
Signed-off-by: Danny Chiao <danny@tecton.ai>
Signed-off-by: Danny Chiao <danny@tecton.ai>
Signed-off-by: Danny Chiao <danny@tecton.ai>
Signed-off-by: Danny Chiao <danny@tecton.ai>
@@ -45,8 +48,9 @@ def test_online_retrieval(environment, universal_data_sources, full_feature_name
"customer_profile:current_balance",
"customer_profile:avg_passenger_count",
"customer_profile:lifetime_trip_count",
"conv_rate_plus_100",
Copy link
Member

Choose a reason for hiding this comment

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

Do we handle a case where this odfv name is the same as a feature name, which we try to get using full_feature_name=False?

Should this instead be conv_rate_plus_100:conv_rate_plus_100, which is basically odfvname:featurename?

Copy link
Member

Choose a reason for hiding this comment

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

@adchia and I talked about this offline; this will likely change in a "prod-ready" release but it's currently experimental.

@@ -0,0 +1,57 @@
//
// Copyright 2020 The Feast Authors
Copy link
Member

Choose a reason for hiding this comment

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

nit, 2021?

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, adchia

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@achals
Copy link
Member

achals commented Sep 2, 2021

/lgtm

@feast-ci-bot feast-ci-bot merged commit 9dc9e60 into feast-dev:master Sep 2, 2021
@adchia adchia deleted the odfv branch September 2, 2021 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants