You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/01 16:08:27 UTC

[GitHub] [superset] diegomedina248 opened a new pull request #19491: fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

diegomedina248 opened a new pull request #19491:
URL: https://github.com/apache/superset/pull/19491


   ### 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:
   
   https://user-images.githubusercontent.com/17252075/161301153-772e3b64-5ff2-4ce0-a41b-372821481fe5.mov
   
   After:
   
   https://user-images.githubusercontent.com/17252075/161300579-d02d006d-999d-43bd-bae7-e6acf3cbd32d.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.
   6. Click on CONNECT.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] diegomedina248 commented on a change in pull request #19491: fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on a change in pull request #19491:
URL: https://github.com/apache/superset/pull/19491#discussion_r840758592



##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -744,6 +748,15 @@ export function useDatabaseValidation() {
                         ),
                       };
                     }
+                    if (extra.issue_codes?.length) {
+                      return {
+                        ...obj,
+                        error_type,
+                        description:
+                          message || extra?.issue_codes?.[0]?.message,

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




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #19491: fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #19491:
URL: https://github.com/apache/superset/pull/19491#issuecomment-1086250233


   # [Codecov](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19491](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6745fac) into [master](https://codecov.io/gh/apache/superset/commit/fc8cb223761ef78f888d5d4dbf038caa1028b277?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fc8cb22) will **decrease** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@            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%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...c/views/CRUD/data/database/DatabaseModal/index.tsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9kYXRhYmFzZS9EYXRhYmFzZU1vZGFsL2luZGV4LnRzeA==) | `32.79% <ø> (ø)` | |
   | [superset-frontend/src/views/CRUD/hooks.ts](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvaG9va3MudHM=) | `46.36% <0.00%> (-0.80%)` | :arrow_down: |
   | [...eFilters/FiltersConfigModal/FiltersConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyc0NvbmZpZ01vZGFsL0ZpbHRlcnNDb25maWdNb2RhbC50c3g=) | `63.04% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset-frontend/src/showSavedQuery/index.jsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Nob3dTYXZlZFF1ZXJ5L2luZGV4LmpzeA==) | `0.00% <0.00%> (ø)` | |
   | [...ntend/packages/superset-ui-core/src/color/utils.ts](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvY29sb3IvdXRpbHMudHM=) | `100.00% <0.00%> (ø)` | |
   | [...ntend/plugins/legacy-plugin-chart-rose/src/Rose.js](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXJvc2Uvc3JjL1Jvc2UuanM=) | `0.00% <0.00%> (ø)` | |
   | [...legacy-preset-chart-deckgl/src/DeckGLContainer.jsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LWRlY2tnbC9zcmMvRGVja0dMQ29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (ø)` | |
   | [...egacy-plugin-chart-world-map/src/ReactWorldMap.jsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXdvcmxkLW1hcC9zcmMvUmVhY3RXb3JsZE1hcC5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [...uperset-ui-core/src/color/CategoricalColorScale.ts](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvY29sb3IvQ2F0ZWdvcmljYWxDb2xvclNjYWxlLnRz) | `100.00% <0.00%> (ø)` | |
   | [...gacy-preset-chart-deckgl/src/components/Legend.jsx](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LWRlY2tnbC9zcmMvY29tcG9uZW50cy9MZWdlbmQuanN4) | `0.00% <0.00%> (ø)` | |
   | ... and [4 more](https://codecov.io/gh/apache/superset/pull/19491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fc8cb22...6745fac](https://codecov.io/gh/apache/superset/pull/19491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codemaster08240328 commented on a change in pull request #19491: fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

Posted by GitBox <gi...@apache.org>.
codemaster08240328 commented on a change in pull request #19491:
URL: https://github.com/apache/superset/pull/19491#discussion_r840750313



##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -744,6 +748,15 @@ export function useDatabaseValidation() {
                         ),
                       };
                     }
+                    if (extra.issue_codes?.length) {
+                      return {
+                        ...obj,
+                        error_type,
+                        description:
+                          message || extra?.issue_codes?.[0]?.message,

Review comment:
       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?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org