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: Dynamic form to connect to Snowflake DB is not displaying authentication errors #19491

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

There are two ways to create a connection with a Snowflake DB:

Using the dynamic form.
Using a SQLAlchemy URI string.
However, the dynamic form is not displaying authentication errors to the user, in case the authentication fails.

This PR adds additional code to trap that error and display it to the user.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-04-01.at.13.07.07.mov

After:

new.mov

TESTING INSTRUCTIONS

  1. Access your Workspace.
  2. Navigate to Data > Databases on the top navigation bar.
  3. Click on +DATABASE.
  4. Select Snowflake.
  5. Fill the form with below information:
  • Database name: testdb
  • Username: test
  • Password: test
  • Account: tfa63492
  • Warehouse: compute_wh
  • Role: public.
  1. Click on CONNECT.

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

...obj,
error_type,
description:
message || extra?.issue_codes?.[0]?.message,
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need conditional sign ? here, because you already checked it in line# 751.
Just use extra.issue_codes[0].message

Btw, are you sure that issue_code has always message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nop, and in that case it will fallback to show the json (like the others)

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #19491 (6745fac) into master (fc8cb22) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #19491      +/-   ##
==========================================
- Coverage   66.59%   66.57%   -0.02%     
==========================================
  Files        1676     1677       +1     
  Lines       64211    64241      +30     
  Branches     6537     6540       +3     
==========================================
+ Hits        42762    42770       +8     
- Misses      19750    19770      +20     
- Partials     1699     1701       +2     
Flag Coverage Δ
javascript 51.31% <0.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
...c/views/CRUD/data/database/DatabaseModal/index.tsx 32.79% <ø> (ø)
superset-frontend/src/views/CRUD/hooks.ts 46.36% <0.00%> (-0.80%) ⬇️
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 63.04% <0.00%> (-1.64%) ⬇️
superset-frontend/src/showSavedQuery/index.jsx 0.00% <0.00%> (ø)
...ntend/packages/superset-ui-core/src/color/utils.ts 100.00% <0.00%> (ø)
...ntend/plugins/legacy-plugin-chart-rose/src/Rose.js 0.00% <0.00%> (ø)
...legacy-preset-chart-deckgl/src/DeckGLContainer.jsx 0.00% <0.00%> (ø)
...egacy-plugin-chart-world-map/src/ReactWorldMap.jsx 0.00% <0.00%> (ø)
...uperset-ui-core/src/color/CategoricalColorScale.ts 100.00% <0.00%> (ø)
...gacy-preset-chart-deckgl/src/components/Legend.jsx 0.00% <0.00%> (ø)
... and 4 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 fc8cb22...6745fac. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM

@rusackas rusackas merged commit 634693b into apache:master Apr 5, 2022
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 5, 2022
…tication errors (apache#19491)

* fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

* pr comments

(cherry picked from commit 634693b)
@sadpandajoe
Copy link
Member

🏷️ preset:2022.13

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
…tication errors (apache#19491)

* fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

* pr comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 preset:2022.13 Preset-Patch size/S 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants