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: failed samples should throw exception #20228

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

zhaoyongjie
Copy link
Member

SUMMARY

Recently, added a new endpoint for getting samples of data. The original PR didn't throw correct HTTP status codes when a dataset contains an incorrect column or calculated column.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

failed_samples.mov

Before

failed_column_before.mov

TESTING INSTRUCTIONS

  1. Make a chart
  2. Add a incorrect calculated column in current dataset
  3. Click Samples Pane in explore page

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

codecov bot commented Jun 1, 2022

Codecov Report

Merging #20228 (5d34da6) into master (9432c62) will increase coverage by 0.02%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master   #20228      +/-   ##
==========================================
+ Coverage   66.46%   66.49%   +0.02%     
==========================================
  Files        1726     1726              
  Lines       64738    64756      +18     
  Branches     6826     6826              
==========================================
+ Hits        43029    43060      +31     
+ Misses      19976    19963      -13     
  Partials     1733     1733              
Flag Coverage Δ
hive 53.70% <38.88%> (-0.01%) ⬇️
javascript 51.33% <50.00%> (+<0.01%) ⬆️
mysql 82.21% <100.00%> (+0.05%) ⬆️
postgres 82.26% <100.00%> (+0.05%) ⬆️
presto 53.56% <38.88%> (-0.01%) ⬇️
python 82.69% <100.00%> (+0.04%) ⬆️
sqlite 82.00% <100.00%> (+0.05%) ⬆️
unit 49.45% <38.88%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...mponents/DataTablesPane/components/SamplesPane.tsx 70.45% <50.00%> (+2.16%) ⬆️
superset/common/utils/query_cache_manager.py 90.21% <100.00%> (+0.80%) ⬆️
superset/datasets/api.py 88.52% <100.00%> (+1.99%) ⬆️
superset/datasets/commands/samples.py 88.88% <100.00%> (+5.55%) ⬆️
superset/connectors/sqla/models.py 90.23% <0.00%> (+0.63%) ⬆️

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 9432c62...5d34da6. Read the comment docs.

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! I'm thinking about whether we need to tell the user exactly which column is reporting an error?

@zhaoyongjie
Copy link
Member Author

LGTM! I'm thinking about whether we need to tell the user exactly which column is reporting an error?

The error depends on the DB response. Typically, the database will tell the end-user which parts of syntax errors are.

@zhaoyongjie zhaoyongjie merged commit 1530c34 into apache:master Jun 1, 2022
@zhaoyongjie zhaoyongjie deleted the fix/fix_samples_exception branch June 2, 2022 02:33
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@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 size/M 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants