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: MySQL et al. super calls #23971

Merged
merged 3 commits into from
May 8, 2023

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented May 8, 2023

SUMMARY

When invoking super we shouldn't explicitly be specifying the MySQLEngineSpec for the type and object_or_type arguments as there's no guarantee that the MySQLEngineSpec class is the class which gets instantiated, i.e., this could serve as a base class for another connector such as a custom StarRocks connector.

The issue with the current implementation is if you provide logic of the following,

class StarRocksEngineSpec(MySQLEngineSpec):
    """
    The StarRocks engine specification.
    """

    disallow_uri_query_params = set()
    enforce_uri_query_params = {}
    engine = "starrocks"
    engine_name = "StarRocks"

when adjust_engine_params is invoked it's using the MySQLEnginSpec.enforce_uri_query_params et al. class level parameters. Simply invoking super without parameters resolves this issue.

I grokked the entire engine specs and made sure that all super calls were of the form super() which mean updating the Ocient connector as well.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@john-bodley john-bodley marked this pull request as ready for review May 8, 2023 19:44
@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #23971 (3a72c4c) into master (9fd936c) will increase coverage by 0.00%.
The diff coverage is 50.00%.

❗ Current head 3a72c4c differs from pull request most recent head ad909d9. Consider uploading reports for the commit ad909d9 to get more accurate results

@@           Coverage Diff           @@
##           master   #23971   +/-   ##
=======================================
  Coverage   68.19%   68.19%           
=======================================
  Files        1941     1941           
  Lines       75242    75217   -25     
  Branches     8157     8146   -11     
=======================================
- Hits        51308    51294   -14     
+ Misses      21851    21845    -6     
+ Partials     2083     2078    -5     
Flag Coverage Δ
hive 53.17% <0.00%> (ø)
mysql 78.90% <50.00%> (ø)
postgres 78.97% <50.00%> (ø)
presto 53.09% <0.00%> (ø)
python 82.75% <50.00%> (ø)
sqlite 77.50% <50.00%> (ø)
unit 52.98% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...uperset-frontend/src/explore/exploreUtils/index.js 78.57% <ø> (-0.19%) ⬇️
superset/db_engine_specs/ocient.py 57.28% <0.00%> (ø)
superset/db_engine_specs/mysql.py 98.82% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@john-bodley john-bodley changed the title fix: MySQL adjust_engine_params fix: MySQL et al. super calls May 8, 2023
Copy link
Member

@michael-s-molina michael-s-molina 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

@justinpark justinpark left a comment

Choose a reason for hiding this comment

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

LGTM

@john-bodley john-bodley merged commit 2af76fc into master May 8, 2023
john-bodley added a commit to airbnb/superset-fork that referenced this pull request May 8, 2023
john-bodley added a commit to airbnb/superset-fork that referenced this pull request May 10, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the john-bodley-fix-mysql-adjust-engine-params branch March 26, 2024 17:59
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/S 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants