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: handle chart/data API errors #14040

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

etr2460
Copy link
Member

@etr2460 etr2460 commented Apr 9, 2021

SUMMARY

Thanks to @betodealmeida's work in #13960, it was pretty trivial to get the new chart data API returning the SIP-40 style error payloads. This PR also refactors the SupersetErrorException a bit to support passing in a SupersetError, naming help for the other exception type would be much appreciated.

TEST PLAN

New unit test, verify that the same error messages are returned when accessing data in a nvd3 line chart and the new table chart and pie chart.

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

to: @betodealmeida @john-bodley @ktmud @graceguo-supercat

@etr2460 etr2460 force-pushed the erik-ritter--chart-data-api-error-handling branch from 59d7480 to 1199437 Compare April 9, 2021 00:18
@betodealmeida
Copy link
Member

Nice! Good catch on SupersetErrorException, I missed the fact that it didn't take an error... it's much better to have it aligned with SupersetErrorsException.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Happy that my PR helped!

@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #14040 (c949851) into master (667eb83) will decrease coverage by 1.21%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##           master   #14040      +/-   ##
==========================================
- Coverage   79.40%   78.18%   -1.22%     
==========================================
  Files         938      938              
  Lines       47541    47533       -8     
  Branches     5940     5940              
==========================================
- Hits        37749    37163     -586     
- Misses       9666    10230     +564     
- Partials      126      140      +14     
Flag Coverage Δ
cypress 51.22% <ø> (-4.84%) ⬇️
hive 80.50% <100.00%> (+0.01%) ⬆️
mysql ?
postgres ?
presto ?
python 80.50% <100.00%> (-0.85%) ⬇️
sqlite ?

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

Impacted Files Coverage Δ
superset/charts/api.py 81.81% <100.00%> (+0.51%) ⬆️
superset/exceptions.py 100.00% <100.00%> (ø)
...ponents/Select/WindowedSelect/WindowedMenuList.tsx 10.71% <0.00%> (-85.72%) ⬇️
...nd/src/filters/components/Select/transformProps.ts 0.00% <0.00%> (-81.82%) ⬇️
...c/filters/components/Select/SelectFilterPlugin.tsx 0.00% <0.00%> (-80.96%) ⬇️
...ontend/src/filters/components/Select/buildQuery.ts 0.00% <0.00%> (-77.78%) ⬇️
superset-frontend/src/filters/components/common.ts 0.00% <0.00%> (-66.67%) ⬇️
superset-frontend/src/dataMask/reducer.ts 44.00% <0.00%> (-56.00%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset-frontend/src/dataMask/actions.ts 33.33% <0.00%> (-46.67%) ⬇️
... and 62 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 667eb83...6d6d874. Read the comment docs.

@etr2460 etr2460 force-pushed the erik-ritter--chart-data-api-error-handling branch from 1199437 to 6d6d874 Compare April 9, 2021 01:14
@etr2460 etr2460 merged commit 3d357c6 into master Apr 9, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
@rusackas rusackas deleted the erik-ritter--chart-data-api-error-handling branch January 30, 2023 19:20
@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/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants