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

chore: Migrate /superset/stop_query/ to API v1 #22624

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

Continuing the effort on deprecating all /superset/ REST API endpoints
Deprecates /stop_query & moves is into api v1

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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 Jan 6, 2023

Codecov Report

Merging #22624 (fbb18b5) into master (5b2ca97) will decrease coverage by 1.37%.
The diff coverage is 92.45%.

❗ Current head fbb18b5 differs from pull request most recent head f6c8e89. Consider uploading reports for the commit f6c8e89 to get more accurate results

@@            Coverage Diff             @@
##           master   #22624      +/-   ##
==========================================
- Coverage   66.88%   65.51%   -1.38%     
==========================================
  Files        1859     1859              
  Lines       71103    71147      +44     
  Branches     7782     7782              
==========================================
- Hits        47557    46610     -947     
- Misses      21520    22511     +991     
  Partials     2026     2026              
Flag Coverage Δ
mysql 77.98% <93.61%> (+0.01%) ⬆️
postgres 78.04% <93.61%> (+<0.01%) ⬆️
presto ?
python 78.16% <93.61%> (-2.89%) ⬇️
sqlite 76.44% <93.61%> (?)
unit ?

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

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/actions/sqlLab.js 63.56% <ø> (ø)
superset/constants.py 100.00% <ø> (ø)
superset/queries/dao.py 92.85% <82.35%> (-7.15%) ⬇️
...ConfigModal/FiltersConfigForm/FilterScope/utils.ts 87.03% <83.33%> (ø)
superset/exceptions.py 91.45% <100.00%> (+0.14%) ⬆️
superset/models/helpers.py 38.02% <100.00%> (ø)
superset/queries/api.py 100.00% <100.00%> (ø)
superset/queries/schemas.py 100.00% <100.00%> (ø)
superset/views/core.py 75.05% <100.00%> (+0.62%) ⬆️
...set/advanced_data_type/plugins/internet_address.py 16.32% <0.00%> (-79.60%) ⬇️
... and 76 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@diegomedina248 diegomedina248 force-pushed the dm/ch42050/migrate-superset-stop-query-to-api-v1 branch from c8b384f to 601562f Compare January 6, 2023 17:33

@staticmethod
def stop_query(client_id: str) -> None:
query = db.session.query(Query).filter_by(client_id=client_id).one()
Copy link
Member

Choose a reason for hiding this comment

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

an invalid client_id will raise, and the API would return HTTP 500, would be nicer to respond HTTP 404


assert rv.status_code == 200
data = json.loads(rv.data.decode("utf-8"))
assert data["result"] == "OK"
Copy link
Member

Choose a reason for hiding this comment

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

add one test for a non existent client_id

@dpgaspar dpgaspar merged commit 3ed288d into apache:master Jan 16, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/XXL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants