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 lint in superset/db_engine_spec #8338

Merged
merged 11 commits into from
Oct 4, 2019

Conversation

willbarrett
Copy link
Member

CATEGORY

Choose one

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

SUMMARY

The db_engine_spec folder was largely un-linted by pylint, due to the presence of the # pylint: disable=C,R,W comment in most of the files. This method of skipping lint checks will hide all pylint failures introduced into the files. This PR removes those lines, fixes a number of pylint errors, and uses a more targeted disable approach for issues that would require larger refactors to resolve. Using this approach for disabling lint should highlight new problems introduced in future PRs and creates a specific list of items to clean up down the road.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

  • Verify tests pass
  • Verify superset runs as expected locally (in progress)

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

Explanation: there was a function in presto.py that I believe was un-referenced: _consolidate_array_data_into_data.

REVIEWERS

@craig-rueda
Copy link
Member

craig-rueda commented Oct 2, 2019

❤️ 👍

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

Oops looks like CI unit tests are failing

@willbarrett
Copy link
Member Author

Yes, it appears so - I think I just need to update a couple tests.

@willbarrett willbarrett force-pushed the wbarrett/db-engine-spec-lint branch from 2f343e9 to 79f4965 Compare October 3, 2019 00:09
@willbarrett
Copy link
Member Author

OK, CI is green - sorry for the many commits. Let me know if you'd like me to squash before merge.

@mistercrunch
Copy link
Member

We force "Squash and merge" on this repo, so every PR gets auto-squashed and we have a 1-to-1 between commits in master and PRs.

@@ -841,47 +843,6 @@ def _process_array_data(
array_value[array_child] = ""
return all_array_data

@classmethod
def _consolidate_array_data_into_data(
Copy link
Member

Choose a reason for hiding this comment

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

unused? @betodealmeida is this used in a cherry or something?

Copy link
Member

Choose a reason for hiding this comment

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

A bit or archeology points to #7625 @khtruong , safe to remove this?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, #8233 simplified the logic and left some methods that are no longer used.

@betodealmeida betodealmeida merged commit ec86d9d into apache:master Oct 4, 2019
serenajiang pushed a commit to airbnb/superset-fork that referenced this pull request Oct 9, 2019
* Enable lint checking for files in db_engine_spec that have few to no
lint issues

* Enable lint and fix issue in db_engine_spec/mysql.py

* Enable pylint and fix lint for db_engine_spec/pinot.py

* Enable lint and fix issues for db_engine_specs/hive.py

* Enable lint and fix for db_engine_spec/presto.py

* Re-enable lint on base.py, fix/disable specific failures, including one
bad method signature

* Make flake8 happy after a number of pylint fixes

* Update db_engine_spec_test test cases related to Presto to support
different method naming

* automated reformatting

* One more pylint disable for druid.py

* Find the magic invocation that makes all the lint tools happy
@willbarrett willbarrett deleted the wbarrett/db-engine-spec-lint branch October 24, 2019 22:23
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.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.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants