-
Notifications
You must be signed in to change notification settings - Fork 16.6k
chore(pylint): Reenable import-outside-toplevel check #16263
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
chore(pylint): Reenable import-outside-toplevel check #16263
Conversation
superset/utils/core.py
Outdated
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.
I'm kind of surprised Mypy didn't pick up on this, i.e., the db_uri could be None though the get_or_create_db is expecting a str rather than Optional[str].
ae7a5d2 to
0755545
Compare
Codecov Report
@@ Coverage Diff @@
## master #16263 +/- ##
=======================================
Coverage 76.49% 76.49%
=======================================
Files 997 997
Lines 53252 53246 -6
Branches 6777 6777
=======================================
- Hits 40734 40731 -3
+ Misses 12288 12285 -3
Partials 230 230
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
villebro
left a comment
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.
LGTM - While local imports are needed in Superset (e.g. when needing functionality from an optional dep), I agree that the linting rule should always be overridden when needed to ensure toplevel importing was considered.
| create a report schedule and nested recipients | ||
| :raises: DAOCreateFailedError | ||
| """ | ||
| import json |
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.
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.
@villebro agreed, though as pointed out in the description this check highlights the cyclical dependencies which unnecessarily exist and we should strive to eradicate.
Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: John Bodley <john.bodley@airbnb.com>

SUMMARY
Re-enabling the Pylint
import-outside-toplevelcheck.Note the presence of the
# pylint: disable=import-outside-toplevelis an indication of the cyclical dependency logic which exists within our code based (stemming from the fact thatsuperset/__init__.pyused to house a significant amount of logic. I realize there have been efforts to remedy this, but it's fairly apparent there's lots more work needed here.TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION