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: invalid DB name error messages (MySQL/Postgres/Redshift) #14146

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

AAfghahi
Copy link
Member

SUMMARY

Capture the most common error messages in MySQL, and return them to the user. This is used when first making a DB.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-04-14 at 1 59 02 PM

TEST PLAN

Unit test included

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

@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #14146 (7e32370) into master (21f973f) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 7e32370 differs from pull request most recent head 2e9a3e1. Consider uploading reports for the commit 2e9a3e1 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14146      +/-   ##
==========================================
+ Coverage   79.70%   79.74%   +0.03%     
==========================================
  Files         945      943       -2     
  Lines       47975    47763     -212     
  Branches     6082     6016      -66     
==========================================
- Hits        38240    38087     -153     
+ Misses       9614     9557      -57     
+ Partials      121      119       -2     
Flag Coverage Δ
hive 80.49% <100.00%> (+<0.01%) ⬆️
javascript 70.17% <ø> (+0.36%) ⬆️
mysql ?
postgres ?
presto 80.51% <100.00%> (+0.01%) ⬆️
python 80.99% <100.00%> (-0.36%) ⬇️
sqlite ?

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

Impacted Files Coverage Δ
...rset-frontend/src/components/ErrorMessage/types.ts 100.00% <ø> (ø)
superset/db_engine_specs/mysql.py 92.53% <100.00%> (-1.41%) ⬇️
superset/db_engine_specs/postgres.py 95.78% <100.00%> (-1.02%) ⬇️
superset/db_engine_specs/redshift.py 94.11% <100.00%> (+0.36%) ⬆️
superset/errors.py 100.00% <100.00%> (ø)
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/databases/commands/create.py 82.35% <0.00%> (-9.81%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/db_engine_specs/sqlite.py 90.62% <0.00%> (-6.25%) ⬇️
superset/models/core.py 85.83% <0.00%> (-3.55%) ⬇️
... and 21 more

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 21f973f...2e9a3e1. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 14, 2021
@AAfghahi AAfghahi changed the title feat: invalid DB name error messages (MySQL) feat: invalid DB name error messages (MySQL/Postgres/Redshift) Apr 14, 2021
@@ -50,6 +50,9 @@
TEST_CONNECTION_HOST_DOWN_REGEX = re.compile(
"Can't connect to MySQL server on '(?P<hostname>.*?)'."
)
TEST_CONNECTION_UNKNOWN_DATABASE_REGEX = re.compile(
"Unknown database '(?P<database>.*?)'."
)
Copy link
Member

Choose a reason for hiding this comment

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

are these going to be the same errors that we'll hit when "creating" a db? Should we be prefixing them all with "TEST?" or it that too specific?

Copy link
Member Author

Choose a reason for hiding this comment

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

would it be better as just connection_ ?

Copy link
Member

Choose a reason for hiding this comment

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

I'll fix it in the Presto PR

@betodealmeida betodealmeida merged commit eadff5f into apache:master Apr 15, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…e#14146)

* initial DB custom errors for mysql

* added redshift and postgres
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants