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: Hugh/migrate estimate query cost to v1 #23226

Merged
merged 18 commits into from
Mar 18, 2023

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Feb 28, 2023

SUMMARY

Taking over from this PR
#22910

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

@zhangzonghai2021
Copy link

zhangzonghai2021 commented Feb 28, 2023 via email

@hughhhh hughhhh changed the title Hugh/migrate estimate query cost to v1 chore: Hugh/migrate estimate query cost to v1 Feb 28, 2023
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #23226 (98e3eed) into master (d950eb8) will increase coverage by 0.05%.
The diff coverage is 98.63%.

❗ Current head 98e3eed differs from pull request most recent head 36d7b66. Consider uploading reports for the commit 36d7b66 to get more accurate results

@@            Coverage Diff             @@
##           master   #23226      +/-   ##
==========================================
+ Coverage   67.61%   67.66%   +0.05%     
==========================================
  Files        1907     1908       +1     
  Lines       73590    73661      +71     
  Branches     7982     7982              
==========================================
+ Hits        49755    49840      +85     
+ Misses      21787    21767      -20     
- Partials     2048     2054       +6     
Flag Coverage Δ
hive 52.74% <55.55%> (+<0.01%) ⬆️
javascript 53.87% <0.00%> (+0.03%) ⬆️
mysql 78.44% <100.00%> (+0.04%) ⬆️
postgres 78.54% <100.00%> (+0.04%) ⬆️
presto 52.67% <55.55%> (+<0.01%) ⬆️
python 82.35% <100.00%> (+0.03%) ⬆️
sqlite 77.01% <100.00%> (+0.04%) ⬆️
unit 52.51% <55.55%> (+<0.01%) ⬆️

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 64.05% <0.00%> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 36.87% <ø> (ø)
superset/security/manager.py 95.94% <ø> (ø)
superset/sqllab/api.py 100.00% <100.00%> (ø)
superset/sqllab/commands/estimate.py 100.00% <100.00%> (ø)
superset/sqllab/schemas.py 100.00% <100.00%> (ø)
superset/views/core.py 74.53% <100.00%> (+0.01%) ⬆️

... and 2 files with indirect coverage changes

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

$ref: '#/components/responses/401'
403:
$ref: '#/components/responses/403'
404:
Copy link
Member

Choose a reason for hiding this comment

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

is 404 possible?

ExecutePayloadSchema,
QueryExecutionResponseSchema,
)

@expose("/estimate/", methods=["POST"])
@protect()
Copy link
Member

Choose a reason for hiding this comment

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

what do you think about adding this endpoint to a can read on SQLLab permission name?

@protect()
@statsd_metrics
@requires_json
@permission_name("get")
Copy link
Member

@dpgaspar dpgaspar Mar 15, 2023

Choose a reason for hiding this comment

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

sorry, having second thoughts on this, let's remove it and leave the permission has it is. can estimate query cost on SQLLab. Also add that permission here: https://github.com/apache/superset/blob/master/superset/security/manager.py#L253

let's add a comment here also: https://github.com/apache/superset/blob/master/UPDATING.md regarding permissions

Copy link
Member Author

Choose a reason for hiding this comment

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

is that a valid permission? I only see allows_cost_estimate as a boolean on the Database model?

Copy link
Member

Choose a reason for hiding this comment

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

it should be can you find estimate_query_cost on ab_permission table?

UPDATING.md Outdated
@@ -24,6 +24,7 @@ assists people when migrating to a new version.

## Next

- [23226](https://github.com/apache/superset/pull/23226) Migrated endpoint `/estimate_query_cost/<int:database_id>` to `/api/v1/sqllab/estimate/`. Corresponding permissions are can_estimate_query_cost on SQLLab. Make sure you add/replace the necessary permissions on any custom roles you may have.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Corresponding permissions are can estimate query cost on SQLLab

@@ -2627,10 +2628,17 @@
"type": "string"
},
"last_saved_by": {
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

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

merge conflict here ^^^

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

LGTM after the docs CI fail is fixed

@hughhhh hughhhh merged commit 8fa77ad into master Mar 18, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the hugh/migrate-estimate_query_cost-to-v1 branch March 26, 2024 17:56
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/L 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants