-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor all importer logic to belong in feast.importer #2199
Conversation
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
sdk/python/feast/importer.py
Outdated
FeastModuleImportError: If the module cannot be imported. | ||
FeastClassImportError: If the class cannot be imported. | ||
""" | ||
if class_type and not class_name.endswith(class_type): |
There was a problem hiding this comment.
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
Signed-off-by: Felix Wang <[email protected]>
Signed-off-by: Felix Wang <[email protected]>
Signed-off-by: Felix Wang <[email protected]>
Signed-off-by: Felix Wang <[email protected]>
55a059b
to
bb1c64d
Compare
Signed-off-by: Felix Wang <[email protected]>
[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 |
/lgtm |
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
, infeast.importer
.Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: