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

Add offline retrival integration tests using the universal repo #1769

Merged
merged 18 commits into from
Aug 16, 2021

Conversation

achals
Copy link
Member

@achals achals commented Aug 9, 2021

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

What this PR does / why we need it:

We wanna start parameterizing over all the possible combinations when reading feature values from the offline feature store. This PR introduces the decorator needed to set up the underlying tables as needed, updates the historical integration test to operate on an Environment object.

$ FEAST_TELEMETRY=False pytest --cov=./ --cov-report=xml --color=yes -s --integration sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py -n 8
======================================================================================= test session starts =======================================================================================
platform darwin -- Python 3.7.11, pytest-6.0.0, py-1.10.0, pluggy-0.13.1
rootdir: /Users/achal/tecton/feast/sdk/python
plugins: cov-2.12.1, xdist-2.3.0, ordering-0.6, mock-1.10.4, timeout-1.4.2, forked-1.3.0, lazy-fixture-0.6.3
gw0 [20] / gw1 [20] / gw2 [20] / gw3 [20] / gw4 [20] / gw5 [20] / gw6 [20] / gw7 [20]
....................

---------- coverage: platform darwin, python 3.7.11-final-0 ----------
Coverage XML written to file coverage.xml

================================================================================= 20 passed in 162.39s (0:02:42) ==================================================================================

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

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

codecov-commenter commented Aug 9, 2021

Codecov Report

Merging #1769 (ef9db2e) into master (7977a53) will decrease coverage by 20.86%.
The diff coverage is 46.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1769       +/-   ##
===========================================
- Coverage   84.65%   63.78%   -20.87%     
===========================================
  Files          85       84        -1     
  Lines        6268     6415      +147     
===========================================
- Hits         5306     4092     -1214     
- Misses        962     2323     +1361     
Flag Coverage Δ
integrationtests ?
unittests 63.78% <46.66%> (-0.74%) ⬇️

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

Impacted Files Coverage Δ
...gration/offline_store/test_historical_retrieval.py 45.59% <0.00%> (-53.37%) ⬇️
...fline_store/test_universal_historical_retrieval.py 20.25% <20.25%> (ø)
...alization/test_offline_online_store_consistency.py 56.57% <33.33%> (-43.43%) ⬇️
...tegration/feature_repos/universal/feature_views.py 63.63% <42.85%> (-36.37%) ⬇️
...ts/integration/feature_repos/universal/entities.py 60.00% <50.00%> (-40.00%) ⬇️
...python/tests/integration/e2e/test_universal_e2e.py 28.88% <55.55%> (-56.48%) ⬇️
...tegration/feature_repos/test_repo_configuration.py 67.17% <66.00%> (-32.83%) ⬇️
...ion/feature_repos/universal/data_source_creator.py 77.77% <83.33%> (-0.80%) ⬇️
.../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 42 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 7977a53...ef9db2e. Read the comment docs.

Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
@achals achals requested a review from adchia August 13, 2021 23:58
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
)
assert_frame_equal(actual_df_from_sql_entities, df_from_sql_entities)

# timestamp_column = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove these?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or if you want to fix it, consider moving into separate test as I suggest below

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to remove them because the behaviour isn't actually consistent across offline stores. File sources don't support sql queries at all.

# ],
# )

job_from_df = store.get_historical_features(
Copy link
Collaborator

Choose a reason for hiding this comment

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

thoughts on splitting sql vs df into two separate tests with the same initial setup? would make it so one can distinguish from test failures whether their bug is in common logic or logic specific to sql vs df

Copy link
Member Author

Choose a reason for hiding this comment

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

I think a single test is better - sql and df params are testing the same API roughly, and tests will run faster if there's fewer separate tests.

@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

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

adchia commented Aug 16, 2021

/lgtm

@feast-ci-bot feast-ci-bot merged commit 351b913 into feast-dev:master Aug 16, 2021
@achals achals deleted the achal/integration-tests-2 branch August 16, 2021 16:32
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