Skip to content

fix: catch exception when create connection#16692

Merged
zhaoyongjie merged 3 commits intoapache:masterfrom
zhaoyongjie:fix_bq_exception
Sep 16, 2021
Merged

fix: catch exception when create connection#16692
zhaoyongjie merged 3 commits intoapache:masterfrom
zhaoyongjie:fix_bq_exception

Conversation

@zhaoyongjie
Copy link
Copy Markdown
Member

@zhaoyongjie zhaoyongjie commented Sep 13, 2021

SUMMARY

In Google bigquery, if credential is not set, it will raise a DefaultCredentialsError, I guess different dialects, will have some custom error types, so here to catch all errors.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After:
image

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

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 13, 2021

Codecov Report

Merging #16692 (acc079d) into master (ad60c0c) will decrease coverage by 0.07%.
The diff coverage is 63.68%.

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

@@            Coverage Diff             @@
##           master   #16692      +/-   ##
==========================================
- Coverage   76.93%   76.86%   -0.08%     
==========================================
  Files        1007     1007              
  Lines       54112    54141      +29     
  Branches     7346     7374      +28     
==========================================
- Hits        41633    41614      -19     
- Misses      12239    12287      +48     
  Partials      240      240              
Flag Coverage Δ
hive ?
mysql 81.71% <56.41%> (+0.06%) ⬆️
postgres 81.81% <56.41%> (+0.10%) ⬆️
presto 81.65% <56.83%> (+0.10%) ⬆️
python 82.07% <56.83%> (-0.19%) ⬇️
sqlite 81.42% <56.41%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
...rontend/src/components/Select/DeprecatedSelect.tsx 82.35% <0.00%> (-3.37%) ⬇️
...ntend/src/explore/components/ExploreChartPanel.jsx 14.28% <0.00%> (-0.72%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/utils/webdriver.py 80.89% <0.00%> (-0.92%) ⬇️
superset/views/base.py 75.65% <42.85%> (-0.86%) ⬇️
superset/viz.py 57.85% <44.38%> (+0.42%) ⬆️
...perset-frontend/src/addSlice/AddSliceContainer.tsx 60.00% <50.00%> (+3.07%) ⬆️
superset/db_engine_specs/bigquery.py 86.84% <66.66%> (-0.92%) ⬇️
...ontrols/DndColumnSelectControl/DndFilterSelect.tsx 51.97% <75.00%> (+0.64%) ⬆️
superset/tasks/async_queries.py 96.96% <90.90%> (ø)
... and 39 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 ad60c0c...c1a7a54. Read the comment docs.

@zhaoyongjie zhaoyongjie force-pushed the fix_bq_exception branch 2 times, most recently from a79a552 to 4386f43 Compare September 14, 2021 05:29
Copy link
Copy Markdown
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Very nice, LGTM!

@zhaoyongjie zhaoyongjie changed the title fix: catch all errors when fetching data of datasource fix: catch exception when create connection Sep 16, 2021
@zhaoyongjie zhaoyongjie merged commit 21f98dd into apache:master Sep 16, 2021
@villebro villebro added the v1.3 label Sep 22, 2021
villebro pushed a commit that referenced this pull request Sep 22, 2021
* fix: catch exception when create connection

* fix lint

* added UT

(cherry picked from commit 21f98dd)
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* fix: catch exception when create connection

* fix lint

* added UT
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* fix: catch exception when create connection

* fix lint

* added UT
@mistercrunch mistercrunch added 🍒 1.3.1 Cherry-picked to 1.3.1 🍒 1.3.2 Cherry-picked to 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 First shipped in 1.4.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 size/S v1.3 🍒 1.3.1 Cherry-picked to 1.3.1 🍒 1.3.2 Cherry-picked to 1.3.2 🚢 1.4.0 First shipped in 1.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants