-
Notifications
You must be signed in to change notification settings - Fork 14.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
chore(pylint): Bump Pylint to 2.9.6 #16146
chore(pylint): Bump Pylint to 2.9.6 #16146
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16146 +/- ##
==========================================
- Coverage 76.73% 76.67% -0.06%
==========================================
Files 997 997
Lines 53230 53069 -161
Branches 6771 6709 -62
==========================================
- Hits 40844 40692 -152
+ Misses 12156 12151 -5
+ Partials 230 226 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
ef95ea5
to
9049df5
Compare
@@ -536,9 +536,10 @@ def get_all_table_names_in_schema( | |||
] | |||
except Exception as ex: # pylint: disable=broad-except | |||
logger.warning(ex) | |||
return [] |
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.
Kind of surprised Mypy didn't find this.
@@ -46,6 +46,7 @@ class TagTypes(enum.Enum): | |||
can find all their objects by querying for the tag `owner:alice`. | |||
""" | |||
|
|||
# pylint: disable=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.
I opted not the change these enums to uppercase as the string representation of the lowercase name is used throughout and I wanted to minimize the size of the PR.
@@ -1228,8 +1228,8 @@ def get_main_metric_name(metrics: Sequence[Metric]) -> Optional[str]: | |||
def ensure_path_exists(path: str) -> None: | |||
try: | |||
os.makedirs(path) | |||
except OSError as exc: | |||
if not (os.path.isdir(path) and exc.errno == errno.EEXIST): | |||
except OSError as ex: |
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.
This fixes a potential bug as exc
is defined globally.
@@ -593,7 +593,7 @@ def geohash_encode( | |||
) | |||
return _append_columns(df, encode_df, {"geohash": geohash}) | |||
except ValueError: | |||
QueryObjectValidationError(_("Invalid longitude/latitude")) | |||
raise QueryObjectValidationError(_("Invalid longitude/latitude")) |
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.
Fixes a potential bug as the exception was never raised.
9d9a1cf
to
eab5634
Compare
superset/cli.py
Outdated
contents = {path.name: open(path).read() for path in files} | ||
contents = {} | ||
for path_ in files: | ||
with open(path_) as file: | ||
contents[path_.name] = file.read() |
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.
This is slightly unrelated, but as you're bumping the indentation, I wonder if we should attempt importing at all if username is None
? And if so (=we assume there may be use cases where an anonymous user can import), shouldn't this added indentation be restored to its original place?
if not all([flt.get(s) for s in ["col", "op"]]): | ||
if not all(flt.get(s) for s in ["col", "op"]): |
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.
If pylint
caught this this is a nice improvement 👍
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 know many people find Pylint somewhat verbose and cumbersome, but the linting rules and checks are far superior than other linters in my opinion.
superset/examples/flights.py
Outdated
del pdf["YEAR"] | ||
del pdf["MONTH"] | ||
del pdf["DAY"] | ||
del pdf["YEAR"] # pylint: disable=unsupported-delete-operation | ||
del pdf["MONTH"] # pylint: disable=unsupported-delete-operation | ||
del pdf["DAY"] # pylint: disable=unsupported-delete-operation |
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.
Should we use drop()
here instead?
f1adab9
to
c800822
Compare
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 once CI passes
c800822
to
8c3d986
Compare
@@ -31,17 +31,20 @@ | |||
|
|||
|
|||
class ScheduleType(str, enum.Enum): | |||
# pylint: disable=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.
I opted not the change these enums (and others) to uppercase as the string representation of the lowercase name is used in the database and I wanted to minimize the size of the PR.
…gies * upstream/master: (64 commits) check roles before fetching reports (#16260) chore: upgrade mypy and add type guards (#16227) fix: pivot columns with ints for name (#16259) chore(pylint): Bump Pylint to 2.9.6 (#16146) fix examples tab for dashboard (#16253) chore: bump superset-ui packages to 0.17.84 (#16251) chore: Shows the dataset description in the gallery dropdown (#16200) fix(Dashboard): Omnibar dropdown visibility and keyboard commands (#16168) chore: bump py version for integration test (#16213) fix: skip perms on query context update (#16250) refactor: external metadata fetch API (#16193) feat(dao): admin can remove self from object owners (#15149) fix(dashboard): cross filter chart highlight when filters badge icon clicked (#16233) fix: validate_parameters and query (#16241) fix: Remove Advanced Analytics tag for 2 charts (#16240) Revert "feat: Changing Dataset names (#16199)" (#16235) feat: Allow users to connect via legacy SQLA form (#16201) fix: remove encryption from db params (#16214) fix(Explore): Show the tooltip only when label does not fit the container in METRICS/FILTERS/GROUP BY/SORT BY of the DATA panel (#16060) Show/hide tooltips (#16192) ... # Conflicts: # superset/tasks/caching/cache_strategy.py
Co-authored-by: John Bodley <[email protected]>
Co-authored-by: John Bodley <[email protected]>
SUMMARY
Bumping Pylint as recent versions address a number of false positives related to
TYPE_CHECKING
. See pylint-dev/pylint#3382 for more details. Sniffed out a couple of bugs in the process.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION