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

Use contextvars to maintain a call stack during the usage calls #1882

Merged

Conversation

achals
Copy link
Member

@achals achals commented Sep 19, 2021

Signed-off-by: Achal Shah achals@gmail.com

What this PR does / why we need it:
Our usage handling doesn't handle calls to usage annotated events within the implementation of get_online_features. So, e.g., calling get_feature_views within get_online_features would always get called, which would result in bad performance.

This fixes that by maintaining the call stack and making sure any call path that includes get_online_features is only sampled.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

none

Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2021

Codecov Report

Merging #1882 (6a4f876) into master (efeea6c) will increase coverage by 0.13%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1882      +/-   ##
==========================================
+ Coverage   83.69%   83.82%   +0.13%     
==========================================
  Files          96       96              
  Lines        7353     7363      +10     
==========================================
+ Hits         6154     6172      +18     
+ Misses       1199     1191       -8     
Flag Coverage Δ
integrationtests 74.55% <94.11%> (+0.12%) ⬆️
unittests 62.40% <88.23%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
sdk/python/feast/usage.py 66.66% <94.11%> (+6.21%) ⬆️
sdk/python/feast/infra/online_stores/datastore.py 93.44% <0.00%> (+2.45%) ⬆️

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 efeea6c...6a4f876. Read the comment docs.

Signed-off-by: Achal Shah <achals@gmail.com>
@adchia adchia self-assigned this Sep 21, 2021
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

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

/lgtm

@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

@feast-ci-bot feast-ci-bot merged commit 3078bfb into feast-dev:master Sep 23, 2021
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