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

Refactor Environment class and DataSourceCreator API, and use fixtures for datasets and data sources #1790

Merged
merged 53 commits into from
Sep 1, 2021

Conversation

achals
Copy link
Member

@achals achals commented Aug 18, 2021

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

What this PR does / why we need it:

This PR introduces a number of changes for speed and customizability:

  • Removed ds and data_source from the Environment class, since they were used in an older version of the Environment.
  • Added a DataSourceCache fixture to re-use staged data for speedups.
  • Split out construct_universal_test_environment and construct_test_environment for both happy path integration tests and non-universal-repo integration tests.
  • Removed the get_prefixed_table_name from the DataSourceCreator since it wasn't needed.

Additionally,

  • Fixed schema inference and added test coverage on all sources.

Which issue(s) this PR fixes:

Fixes #1797

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 18, 2021

Codecov Report

Merging #1790 (ff1fb81) into master (3c39261) will decrease coverage by 0.67%.
The diff coverage is 93.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1790      +/-   ##
==========================================
- Coverage   85.32%   84.64%   -0.68%     
==========================================
  Files          93       93              
  Lines        6950     6812     -138     
==========================================
- Hits         5930     5766     -164     
- Misses       1020     1046      +26     
Flag Coverage Δ
integrationtests 84.57% <93.45%> (-0.69%) ⬇️
unittests 63.78% <42.90%> (+0.19%) ⬆️

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

Impacted Files Coverage Δ
sdk/python/feast/infra/offline_stores/bigquery.py 80.30% <ø> (ø)
sdk/python/feast/infra/utils/aws_utils.py 88.34% <ø> (-2.92%) ⬇️
...ion/feature_repos/universal/data_source_creator.py 80.00% <ø> (+2.22%) ⬆️
...alization/test_offline_online_store_consistency.py 86.98% <ø> (-13.02%) ⬇️
...tegration/offline_store/test_s3_custom_endpoint.py 24.00% <25.00%> (-5.42%) ⬇️
sdk/python/feast/feature_view.py 86.30% <57.14%> (-0.75%) ⬇️
sdk/python/feast/type_map.py 67.46% <71.42%> (+2.46%) ⬆️
sdk/python/tests/conftest.py 96.29% <91.30%> (-3.71%) ⬇️
...ation/feature_repos/universal/data_sources/file.py 66.66% <93.33%> (+2.15%) ⬆️
...n/feature_repos/universal/data_sources/bigquery.py 97.61% <94.11%> (-2.39%) ⬇️
... and 19 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 3c39261...ff1fb81. 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>
@achals achals changed the title Remove get_prefixed_table_name from DataSourceCreator API Refactor Environment class and DataSourceCreator API Aug 19, 2021
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 changed the title Refactor Environment class and DataSourceCreator API, and introduce data source cache for tests Refactor Environment class and DataSourceCreator API, and use fixtures for datasets and data sources Sep 1, 2021
Signed-off-by: Achal Shah <achals@gmail.com>
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

provider: str = "local"
online_store: Union[str, Dict] = "sqlite"

offline_store_creator: str = "tests.integration.feature_repos.universal.data_sources.file.FileDataSourceCreator"
Copy link
Member

Choose a reason for hiding this comment

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

Apologies if this has been mentioned before, but can you remind me why we use a string reference to the class instead of a code reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mainly to not have the repo_configuration file not have any code dependency on any specific offline store, similar to the online/offline store config.

Copy link
Member

Choose a reason for hiding this comment

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

Is there any downside to having that code dependency?

Copy link
Member Author

@achals achals Sep 1, 2021

Choose a reason for hiding this comment

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

Oops missed this. For tests, presumably not. However I can imagine we'll want this to be extensible to support the test suite for when users bring their own offline stores with a custom DataSourceCreator, so it may be needed then. Happy to change it for YAGNI, or keep it for forward looking flexibility

Copy link
Member

Choose a reason for hiding this comment

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

My personal preference is to YAGNI this baby until we need it, just because I feel like we might run into bugs with these strings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aight sg

Signed-off-by: Achal Shah <achals@gmail.com>
@feast-ci-bot feast-ci-bot removed the lgtm label Sep 1, 2021
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>
@woop
Copy link
Member

woop commented Sep 1, 2021

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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 66cf6a4 into feast-dev:master Sep 1, 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.

Feature inferencing tests fail
5 participants