-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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): Remove top-level disable #16589
chore(pylint): Remove top-level disable #16589
Conversation
20a8566
to
1ecd28d
Compare
e264479
to
50fd6a3
Compare
Codecov Report
@@ Coverage Diff @@
## master #16589 +/- ##
==========================================
- Coverage 76.93% 76.76% -0.18%
==========================================
Files 1007 1007
Lines 54112 54101 -11
Branches 7346 7367 +21
==========================================
- Hits 41633 41531 -102
- Misses 12239 12330 +91
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
50fd6a3
to
2a00cf1
Compare
from superset.utils.public_interfaces import compute_hash, get_warning_message | ||
from tests.integration_tests.base_tests import SupersetTestCase |
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.
Unused.
hashes = { | ||
dummy_sql_query_mutator: "Kv%NM3b;7BcpoD2wbPkW", | ||
} | ||
hashes: Dict[Callable[..., Any], str] = {} |
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 issues in referencing the `app.config["SQL_QUERY_MUTATOR"] because i) the app was the test rather than the default config, and ii) the test wasn't running within an app context. Furthermore it's unclear why the default SQL query mutator was needed explicit checking compared to say any other of the default interfaces.
bc8e960
to
13ca5c4
Compare
13ca5c4
to
11059cf
Compare
8f5ba9f
to
02f2710
Compare
@@ -52,25 +50,13 @@ | |||
from superset.utils.dates import now_as_float | |||
from superset.utils.decorators import stats_timing | |||
|
|||
|
|||
# pylint: disable=unused-argument, redefined-outer-name | |||
def dummy_sql_query_mutator( |
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.
Note I don't believe moving this is to config.py
is a breaking change since any custom logic would already be defined in a custom config override.
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
@@ -984,7 +985,14 @@ def CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC( | |||
# def SQL_QUERY_MUTATOR(sql, user_name, security_manager, database): | |||
# dttm = datetime.now().isoformat() | |||
# return f"-- [SQL LAB] {username} {dttm}\n{sql}" | |||
SQL_QUERY_MUTATOR = None | |||
def SQL_QUERY_MUTATOR( # pylint: disable=invalid-name,unused-argument |
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.
Which one is the invalid-name
?
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.
@ktmud Pylint doesn’t like capitals in function names.
* chore(pylint): Remove top-level disable * Update examples.py * Update command.py Co-authored-by: John Bodley <[email protected]>
* chore(pylint): Remove top-level disable * Update examples.py * Update command.py Co-authored-by: John Bodley <[email protected]>
SUMMARY
Generally top-level Pylint disable should be discouraged (except for a few necessary exceptions related to imports and number of lines) as they can mask a number of issues. This PR moves top-level Pylint disable messages to the relevant scope (and fixes a number of issues which surfaced by doing so).
Note the bulk of the changes are in
superset/viz.py
which I gather could be slated for deprecation.TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION