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: The dynamic form to connect to Snowflake DB is not returning any errors #20013

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 reintroduces the fixes from #19491 that were overridden in #19165

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

161301153-772e3b64-5ff2-4ce0-a41b-372821481fe5.mov

After:

new.mp4

TESTING INSTRUCTIONS

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

Copy link
Member

@stephenLYZ stephenLYZ left a comment

Choose a reason for hiding this comment

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

LGTM and just leave a nit. Thanks for the fix.

return (
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message={t('Database Creation Error')}
description={message?.[0] || dbErrors}
description={alertErrors?.[0]}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like ?. is an unnecessary logic and it's better to use t function to wrap it.

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #20013 (f68bd15) into master (fff9ad0) will decrease coverage by 0.00%.
The diff coverage is 9.09%.

❗ Current head f68bd15 differs from pull request most recent head 768cecf. Consider uploading reports for the commit 768cecf to get more accurate results

@@            Coverage Diff             @@
##           master   #20013      +/-   ##
==========================================
- Coverage   66.36%   66.35%   -0.01%     
==========================================
  Files        1712     1712              
  Lines       64088    64089       +1     
  Branches     6744     6745       +1     
==========================================
- Hits        42529    42528       -1     
- Misses      19846    19848       +2     
  Partials     1713     1713              
Flag Coverage Δ
javascript 51.31% <9.09%> (-0.01%) ⬇️

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.33% <9.09%> (-0.37%) ⬇️

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 fff9ad0...768cecf. Read the comment docs.

@diegomedina248 diegomedina248 force-pushed the fix/the-dynamic-form-to-connect-to-snowflake-db-is-not-returning-any-errors branch from caf46c0 to 768cecf Compare May 12, 2022 20:32
return (
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message={t('Database Creation Error')}
description={message?.[0] || dbErrors}
description={t(alertErrors[0])}
Copy link
Member

Choose a reason for hiding this comment

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

Looking above at line 1095, it seems there's a condition where alertErrors might be [], in which case this would be translating/displaying undefined right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're checking for content in 1098

Copy link
Member

Choose a reason for hiding this comment

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

lol 🤦

@rusackas rusackas merged commit c6dd7fe into apache:master May 13, 2022
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request May 16, 2022
… errors (apache#20013)

* fix: The dynamic form to connect to Snowflake DB is not returning any errors

* PR comment

(cherry picked from commit c6dd7fe)
@sadpandajoe
Copy link
Member

🏷️ preset:2022.19

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

* fix: The dynamic form to connect to Snowflake DB is not returning any errors

* PR comment
@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.19 Preset-Patch size/M 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants