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

feat: Expanded Parameters for Mysql #14680

Merged
merged 4 commits into from
May 19, 2021

Conversation

AAfghahi
Copy link
Member

SUMMARY

MySQL databases can now use the expanded parameters provided by the BasicParametersMixin to create new databases.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

Added unit tests.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

superset/db_engine_specs/mysql.py Outdated Show resolved Hide resolved
@@ -1454,3 +1454,25 @@ def test_validate_parameters_invalid_host(self, is_hostname_valid):
},
]
}

def test_validate_parameters_with_mysql(self):
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this test. If we're passing the correct parameters why do we expect the status code to be 422?

You probably only need to update this test (which should fail otherwise with your PR): https://github.com/apache/superset/pull/14208/files#diff-b8428a369bdee6a99d7d4da28161a32d50477174192f9fade2040a335a4f2e42R1254

Copy link
Member Author

Choose a reason for hiding this comment

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

oh huh, I had it with rv.status 200 and it was passing. But you're right.

AAfghahi and others added 3 commits May 18, 2021 09:39
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@pull-request-size pull-request-size bot added size/M and removed size/S labels May 18, 2021
@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #14680 (90845af) into master (32f5f36) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14680      +/-   ##
==========================================
+ Coverage   77.51%   77.55%   +0.04%     
==========================================
  Files         958      958              
  Lines       48560    48563       +3     
  Branches     5703     5703              
==========================================
+ Hits        37642    37664      +22     
+ Misses      10718    10699      -19     
  Partials      200      200              
Flag Coverage Δ
hive 81.11% <100.00%> (+<0.01%) ⬆️
mysql 81.38% <100.00%> (+<0.01%) ⬆️
postgres 81.41% <100.00%> (?)
presto 81.10% <100.00%> (+<0.01%) ⬆️
python 81.93% <100.00%> (+0.07%) ⬆️
sqlite 81.03% <100.00%> (?)

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

Impacted Files Coverage Δ
superset/db_engine_specs/mysql.py 94.28% <100.00%> (+0.25%) ⬆️
superset/connectors/sqla/models.py 90.09% <0.00%> (+0.24%) ⬆️
superset/views/base_api.py 98.28% <0.00%> (+0.42%) ⬆️
superset/utils/cache.py 74.25% <0.00%> (+0.99%) ⬆️
superset/db_engine_specs/postgres.py 96.96% <0.00%> (+1.01%) ⬆️
superset/result_set.py 98.38% <0.00%> (+1.61%) ⬆️
superset/utils/celery.py 89.65% <0.00%> (+3.44%) ⬆️
superset/db_engine_specs/sqlite.py 96.87% <0.00%> (+6.25%) ⬆️
superset/sql_validators/postgres.py 100.00% <0.00%> (+50.00%) ⬆️

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 5776dcb...90845af. Read the comment docs.


@mock.patch("superset.databases.api.get_available_engine_specs")
@mock.patch("superset.databases.api.app")
def test_available_with_mysql(self, app, get_available_engine_specs):
Copy link
Member

Choose a reason for hiding this comment

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

You could've combined this and the test above in a single one:

get_available_engine_specs.return_value = [
    PostgresEngineSpec,
    MySQLEngineSpec,
    HanaEngineSpec,
]

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah! Originally it was this, but I thought that as we add engines to this list that this test might get unwieldy and huge so it might be better to split up each engine spec.

@betodealmeida betodealmeida merged commit 67e3730 into apache:master May 19, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* added mysql form

* revisions

* Update superset/db_engine_specs/mysql.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* added ssl and mysql testing

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* added mysql form

* revisions

* Update superset/db_engine_specs/mysql.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* added ssl and mysql testing

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* added mysql form

* revisions

* Update superset/db_engine_specs/mysql.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* added ssl and mysql testing

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 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/M 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants