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(15403): Re-enable canceling query for Hive and Presto #15878

Merged

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jul 23, 2021

SUMMARY

Both the Hive and Presto live cursors have implicit async handling to cancel queries, however post #15403 when you stop a query in SQL Lab it incorrectly mentioned that the query could not be stopped and thus prevented to user from iterating within the SQL editor.

This PR adds a new method to check if the database implicitly handles the canceling of queries.

TESTING INSTRUCTIONS

Added unit tests.

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

cc: @koszti

if cancel_query_id is None:
return False

database = query.database
engine = database.get_sqla_engine(
engine = query.database.get_sqla_engine(
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing interim variables which likely add unnecessary obfuscation.

@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #15878 (5fa2e2f) into master (f9b7250) will decrease coverage by 0.07%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15878      +/-   ##
==========================================
- Coverage   77.08%   77.01%   -0.08%     
==========================================
  Files         984      984              
  Lines       51787    51797      +10     
  Branches     7031     7031              
==========================================
- Hits        39918    39889      -29     
- Misses      11644    11683      +39     
  Partials      225      225              
Flag Coverage Δ
hive 81.28% <66.66%> (+<0.01%) ⬆️
mysql 81.54% <66.66%> (+<0.01%) ⬆️
postgres 81.56% <66.66%> (+<0.01%) ⬆️
presto ?
python 81.94% <66.66%> (-0.14%) ⬇️
sqlite 81.20% <66.66%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/sql_lab.py 80.70% <40.00%> (+0.78%) ⬆️
superset/db_engine_specs/base.py 88.37% <50.00%> (-0.30%) ⬇️
superset/db_engine_specs/hive.py 86.66% <100.00%> (+0.15%) ⬆️
superset/db_engine_specs/presto.py 84.51% <100.00%> (-5.38%) ⬇️
superset/connectors/sqla/models.py 88.55% <0.00%> (-1.41%) ⬇️
superset/models/core.py 89.61% <0.00%> (-0.26%) ⬇️

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 f9b7250...5fa2e2f. Read the comment docs.

Copy link

@graceguo-supercat graceguo-supercat left a comment

Choose a reason for hiding this comment

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

LGTM

@john-bodley john-bodley merged commit 6d3e19d into apache:master Jul 26, 2021
@john-bodley john-bodley deleted the john-bodley--cancel-query-hive-et-al branch July 26, 2021 15:05
john-bodley added a commit to airbnb/superset-fork that referenced this pull request Jul 26, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
(cherry picked from commit 6d3e19d)
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
Co-authored-by: John Bodley <john.bodley@airbnb.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants