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: sql lab crash caused by invalid template #17133

Merged

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Oct 15, 2021

SUMMARY

If user has invalid template in the query and run the query, SQL Lab will crash.
The error returned from backend seems not compatible with front-end error handle logic.
Front-end is expecting an extra object and has a list of issue_codes in extra object. but currently error contains single error message.

Screen_Shot_2021-10-15_at_2_07_24_PM

This PR is only a short solution in the frontend to handle JS error in the current format, so that our sql lab users won't be blocked by simple syntax error. The root cause of the problem need further refactor work.

BEFORE/AFTER SCREENSHOTS OR

Before: SQL Lab page is blank

After:
Screen Shot 2021-10-15 at 2 26 16 PM

TESTING INSTRUCTIONS

CI and manual test

ADDITIONAL INFORMATION

  • Has associated issue: fix: error alerts js crash #17015
  • 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

cc @etr2460 @ofekisr

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #17133 (05b4e3c) into master (4a9107d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17133   +/-   ##
=======================================
  Coverage   76.94%   76.94%           
=======================================
  Files        1031     1031           
  Lines       55229    55231    +2     
  Branches     7516     7519    +3     
=======================================
+ Hits        42496    42498    +2     
  Misses      12482    12482           
  Partials      251      251           
Flag Coverage Δ
javascript 70.92% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
.../components/ErrorMessage/ParameterErrorMessage.tsx 97.05% <100.00%> (+0.18%) ⬆️

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 4a9107d...05b4e3c. Read the comment docs.

@graceguo-supercat graceguo-supercat merged commit 96f4421 into apache:master Oct 18, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
@eschutho eschutho added the v1.4 label Nov 23, 2021
eschutho pushed a commit that referenced this pull request Nov 23, 2021
@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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/XS v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants