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

Fix a bunch of files with pylint disabled #8743

Merged
merged 15 commits into from
Dec 11, 2019

Conversation

willbarrett
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Re-enable pylint on a number of files with pylint globally disabled.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

No UI changes.

TEST PLAN

  • Run lint
  • Run tests

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@john-bodley

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

a couple suggestions

@@ -273,5 +272,5 @@ class HiveTemplateProcessor(PrestoTemplateProcessor):


def get_template_processor(database, table=None, query=None, **kwargs):
TP = template_processors.get(database.backend, BaseTemplateProcessor)
return TP(database=database, table=table, query=query, **kwargs)
tp = template_processors.get(database.backend, BaseTemplateProcessor)
Copy link
Member

Choose a reason for hiding this comment

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

why not name template_processor?

database = query.database
db_engine_spec = database.db_engine_spec
parsed_query = ParsedQuery(sql_statement)
sql = parsed_query.stripped()
SQL_MAX_ROWS = app.config["SQL_MAX_ROW"]
sql_max_rows = app.config["SQL_MAX_ROW"]
Copy link
Member

Choose a reason for hiding this comment

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

should this be pulled out of the function to the top of the file? Then we keep the same var name but don't need to refetch from the app config each time

SQL_QUERY_MUTATOR = config["SQL_QUERY_MUTATOR"]
if SQL_QUERY_MUTATOR:
sql = SQL_QUERY_MUTATOR(sql, user_name, security_manager, database)
sql_query_mutator = config["SQL_QUERY_MUTATOR"]
Copy link
Member

Choose a reason for hiding this comment

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

same comment here

@codecov-io
Copy link

codecov-io commented Dec 4, 2019

Codecov Report

Merging #8743 into master will decrease coverage by <.01%.
The diff coverage is 69.47%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #8743      +/-   ##
=========================================
- Coverage    65.9%   65.9%   -0.01%     
=========================================
  Files         483     483              
  Lines       24166   24166              
  Branches     2770    2770              
=========================================
- Hits        15927   15926       -1     
- Misses       8061    8062       +1     
  Partials      178     178
Impacted Files Coverage Δ
superset/exceptions.py 100% <ø> (ø) ⬆️
superset/translations/utils.py 87.5% <0%> (ø) ⬆️
superset/jinja_context.py 74.73% <100%> (ø) ⬆️
superset/views/log/views.py 100% <100%> (ø) ⬆️
superset/views/schedules.py 58.03% <40.9%> (ø) ⬆️
superset/views/annotations.py 79.06% <50%> (ø) ⬆️
superset/sql_lab.py 77.57% <68.75%> (-0.47%) ⬇️
superset/views/base.py 75% <85.71%> (+0.25%) ⬆️
superset/sql_parse.py 96.12% <89.47%> (ø) ⬆️

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 adf2cc2...ca01485. Read the comment docs.

@willbarrett willbarrett requested a review from etr2460 December 4, 2019 18:42
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

assuming pylint and tests pass, lgtm.

one comment, but not required to address in this pass

import logging
import uuid
from contextlib import closing
from datetime import datetime
from sys import getsizeof
from typing import Optional, Tuple, Union

# pylint and isort disagree on the correct import order.
# Let's have isort win.
# pylint: disable=ungrouped-imports
Copy link
Member

Choose a reason for hiding this comment

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

should we add this to a base pylint rule disable? so that we don't need it on a bunch of files?

Copy link
Member

@john-bodley john-bodley Dec 10, 2019

Choose a reason for hiding this comment

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

I’m a little perplexed as to why pylint is complaining here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. Not a bad idea. Will update here before I forget.

@mistercrunch mistercrunch merged commit 562aeab into apache:master Dec 11, 2019
@mistercrunch mistercrunch deleted the wbarrett/more-pylint branch December 11, 2019 18:14
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants