Skip to content

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

Merged
feast-ci-bot merged 53 commits into
feast-dev:masterfrom
achals:achal/integration-test-fixups
Sep 1, 2021
Merged

Refactor Environment class and DataSourceCreator API, and use fixtures for datasets and data sources#1790
feast-ci-bot merged 53 commits into
feast-dev:masterfrom
achals:achal/integration-test-fixups

Conversation

@achals

@achals achals commented Aug 18, 2021

Copy link
Copy Markdown
Member

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

codecov-commenter commented Aug 18, 2021

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 93.45455% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.64%. Comparing base (3c39261) to head (ff1fb81).
⚠️ Report is 2635 commits behind head on master.

Files with missing lines Patch % Lines
...tegration/offline_store/test_s3_custom_endpoint.py 25.00% 9 Missing ⚠️
sdk/python/feast/feature_view.py 57.14% 3 Missing ⚠️
sdk/python/feast/type_map.py 71.42% 2 Missing ⚠️
sdk/python/tests/conftest.py 91.30% 2 Missing ⚠️
...n/feature_repos/universal/data_sources/bigquery.py 94.11% 1 Missing ⚠️
...ation/feature_repos/universal/data_sources/file.py 93.33% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            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.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

achals added 2 commits August 18, 2021 15:16
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
achals added 6 commits August 18, 2021 17:13
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
Comment thread sdk/python/tests/integration/feature_repos/test_repo_configuration.py Outdated
Comment thread sdk/python/tests/integration/feature_repos/universal/data_source_creator.py Outdated
Comment thread sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py Outdated
Comment thread sdk/python/tests/integration/feature_repos/test_repo_configuration.py Outdated
achals added 2 commits August 19, 2021 10:04
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Comment thread sdk/python/feast/infra/utils/aws_utils.py Outdated
achals added 2 commits August 19, 2021 10:57
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
achals added 5 commits August 31, 2021 21:44
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>

@adchia adchia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

Comment thread sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py Outdated
Comment thread sdk/python/feast/infra/provider.py
Comment thread sdk/python/tests/integration/e2e/test_universal_e2e.py Outdated
Comment thread sdk/python/tests/integration/e2e/test_universal_e2e.py Outdated
provider: str = "local"
online_store: Union[str, Dict] = "sqlite"

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@achals achals Sep 1, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Aight sg

Comment thread sdk/python/tests/integration/feature_repos/universal/data_source_creator.py Outdated
Comment thread sdk/python/tests/integration/feature_repos/universal/data_source_creator.py Outdated
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

woop commented Sep 1, 2021

Copy link
Copy Markdown
Member

/lgtm

@feast-ci-bot

Copy link
Copy Markdown
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

Details 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