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): SQL Lab Compile Query Delay #20206

Merged

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

There's currently a lag when entering a query in the SQL Lab.
If you set some text and immediately submit the query, you'll most likely get the previous stored query executed.
This is specially notorious if you use keyboard shortcuts to fire the query.

This PR removes the sql query stored locally in the component in favor of the one stored in the redux store, to prevent the two states to be out of sync.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

old.mov

After:

new.mov

TESTING INSTRUCTIONS

  1. Type Select 1 in SQL Lab
  2. Immediately change to 1 to 2
  3. Use ctrl+enter to run the query

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 May 26, 2022

Codecov Report

Merging #20206 (46317c8) into master (64c4226) will increase coverage by 0.00%.
The diff coverage is 35.71%.

@@           Coverage Diff           @@
##           master   #20206   +/-   ##
=======================================
  Coverage   66.46%   66.46%           
=======================================
  Files        1727     1727           
  Lines       64702    64701    -1     
  Branches     6824     6822    -2     
=======================================
+ Hits        43001    43002    +1     
+ Misses      19969    19968    -1     
+ Partials     1732     1731    -1     
Flag Coverage Δ
javascript 51.33% <35.71%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...ntend/src/SqlLab/components/QueryHistory/index.tsx 66.66% <ø> (ø)
...ontend/src/SqlLab/components/QuerySearch/index.tsx 73.07% <ø> (ø)
...rontend/src/SqlLab/components/QueryTable/index.tsx 70.17% <0.00%> (ø)
...frontend/src/SqlLab/components/SouthPane/index.tsx 65.62% <ø> (ø)
...frontend/src/SqlLab/components/SqlEditor/index.jsx 51.36% <27.27%> (+0.82%) ⬆️
superset-frontend/src/SqlLab/actions/sqlLab.js 60.50% <100.00%> (+0.11%) ⬆️
superset-frontend/src/components/Modal/Modal.tsx 85.93% <0.00%> (-0.22%) ⬇️

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 64c4226...46317c8. Read the comment docs.

Copy link
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.

Funny, I had never run into this before, but this was a really bad bug. LGTM and tested before and after and change works as expected (I did notice a lot of unrelated rerendering going on when typing stuff in the editor, but that's obviously outside the scope of this PR). Great work!

@villebro villebro merged commit 653cf77 into apache:master May 27, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Jul 5, 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 Preset-Patch size/M 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants