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 all importer logic to belong in feast.importer #2199

Merged
merged 5 commits into from
Jan 7, 2022

Conversation

felixwang9817
Copy link
Collaborator

Signed-off-by: Felix Wang [email protected]

What this PR does / why we need it: This PR takes all importer logic and refactors it so that all importer logic belongs to a single method, get_class_from_module, in feast.importer.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2022

Codecov Report

Merging #2199 (1edcc37) into master (14048fd) will decrease coverage by 0.17%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2199      +/-   ##
==========================================
- Coverage   84.63%   84.45%   -0.18%     
==========================================
  Files         104      104              
  Lines        8272     8247      -25     
==========================================
- Hits         7001     6965      -36     
- Misses       1271     1282      +11     
Flag Coverage Δ
integrationtests 74.20% <83.33%> (-0.48%) ⬇️
unittests 58.65% <80.00%> (-0.31%) ⬇️

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

Impacted Files Coverage Δ
.../python/tests/integration/registration/test_cli.py 100.00% <ø> (ø)
sdk/python/feast/importer.py 64.28% <50.00%> (ø)
sdk/python/feast/infra/infra_object.py 57.50% <50.00%> (ø)
sdk/python/feast/errors.py 71.11% <75.00%> (ø)
...python/feast/infra/offline_stores/offline_utils.py 95.74% <100.00%> (+3.66%) ⬆️
sdk/python/feast/infra/online_stores/helpers.py 100.00% <100.00%> (+12.90%) ⬆️
sdk/python/feast/infra/provider.py 90.17% <100.00%> (+0.08%) ⬆️
sdk/python/feast/registry.py 83.60% <100.00%> (-1.68%) ⬇️
sdk/python/feast/repo_config.py 87.00% <100.00%> (ø)
sdk/python/feast/type_map.py 60.93% <0.00%> (-11.72%) ⬇️
... and 7 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 14048fd...1edcc37. Read the comment docs.

FeastModuleImportError: If the module cannot be imported.
FeastClassImportError: If the class cannot be imported.
"""
if class_type and not class_name.endswith(class_type):
Copy link
Collaborator

@pyalex pyalex Jan 7, 2022

Choose a reason for hiding this comment

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

alternatively, we can make class_type something like base class expectations, eg we import class FileStorage and expect that it's a subtype of Storage.

Check base classes of imported type instead of naming could look like this

if not any(base_class.__name__ in class_type for base_class _class.__bases__):
    raise 

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: felixwang9817, pyalex

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

@pyalex
Copy link
Collaborator

pyalex commented Jan 7, 2022

/lgtm

@feast-ci-bot feast-ci-bot merged commit b4d12bd into feast-dev:master Jan 7, 2022
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.

6 participants