Skip to content

refactor(sqllab): migrate share queries via kv by permalink - #29163

Merged
justinpark merged 13 commits into
apache:masterfrom
justinpark:refactor--migrate-copy-query-via-permalink
Jan 18, 2025
Merged

refactor(sqllab): migrate share queries via kv by permalink#29163
justinpark merged 13 commits into
apache:masterfrom
justinpark:refactor--migrate-copy-query-via-permalink

Conversation

@justinpark

@justinpark justinpark commented Jun 10, 2024

Copy link
Copy Markdown
Member

SUMMARY

This PR changes the existing SHARE_QUERIES_VIA_KV_STORE feature to store data using the permalink API instead of the KV store. This is one of the prerequisites of Remove old KV store endpoint and its associated asset.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

after--permalink2.mov

TESTING INSTRUCTIONS

Go to SQL Lab and then click "Copy Link"

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

@justinpark
justinpark requested a review from betodealmeida June 10, 2024 20:04
@github-actions github-actions Bot added the api Related to the REST API label Jun 10, 2024
@dosubot dosubot Bot added the sqllab Namespace | Anything related to the SQL Lab label Jun 10, 2024
@codecov

codecov Bot commented Jun 10, 2024

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.74194% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.45%. Comparing base (76d897e) to head (45e570b).
⚠️ Report is 2203 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/sql_lab/permalink/get.py 70.27% 11 Missing ⚠️
superset/sqllab/permalink/api.py 90.19% 5 Missing ⚠️
superset/commands/sql_lab/permalink/create.py 88.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29163       +/-   ##
===========================================
+ Coverage   60.48%   83.45%   +22.97%     
===========================================
  Files        1931      546     -1385     
  Lines       76236    39249    -36987     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32757    -13357     
+ Misses      28017     6492    -21525     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.41% <67.74%> (-0.75%) ⬇️
javascript ?
mysql 74.78% <87.74%> (?)
postgres 74.79% <87.74%> (?)
presto 51.99% <67.74%> (-1.82%) ⬇️
python 83.28% <87.74%> (+19.78%) ⬆️
sqlite 74.23% <87.74%> (?)
unit 60.86% <67.74%> (+3.22%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@villebro

Copy link
Copy Markdown
Member

/testenv up

@github-actions

Copy link
Copy Markdown
Contributor

@villebro Ephemeral environment spinning up at http://52.37.81.73:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@villebro

Copy link
Copy Markdown
Member

/testenv up FEATURE_SHARE_QUERIES_VIA_KV_STORE=true

@github-actions

Copy link
Copy Markdown
Contributor

@villebro Ephemeral environment spinning up at http://35.86.167.107:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@villebro villebro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great improvement, this is long overdue! I suggest removing the SHARE_QUERIES_VIA_KV_STORE feature flag, and making the permalink only store the selected portion of the editor. Other than that this looks great!

Comment thread superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx Outdated
@michael-s-molina

Copy link
Copy Markdown
Member

I suggest removing the SHARE_QUERIES_VIA_KV_STORE feature flag, and making the permalink only store the selected portion of the editor.

@villebro There's a proposal in 5.0 to remove this feature flag.

@justinpark

Copy link
Copy Markdown
Member Author

@villebro @michael-s-molina could you take a look?

@michael-s-molina

Copy link
Copy Markdown
Member

Can you add support for old saved query URLs?

@michael-s-molina michael-s-molina added the risk:breaking-change Issues or PRs that will introduce breaking changes label Jul 25, 2024
@justinpark
justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from 26036ce to a55adb7 Compare January 13, 2025 23:04
@justinpark

Copy link
Copy Markdown
Member Author

Can you add support for old saved query URLs?

Done. @michael-s-molina PTAL

Comment thread RESOURCES/FEATURE_FLAGS.md Outdated
Comment thread UPDATING.md Outdated
@justinpark
justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from f1afa3e to 004f52b Compare January 14, 2025 16:59
Comment thread RESOURCES/FEATURE_FLAGS.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you forget to remove the SHARE_QUERIES_VIA_KV_STORE and KV_STORE from this document?

Comment thread UPDATING.md Outdated
Comment thread superset-frontend/src/types/bootstrapTypes.ts Outdated

@michael-s-molina michael-s-molina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing the comments @justinpark!

@justinpark
justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from 8912670 to 45e570b Compare January 17, 2025 17:43
@justinpark
justinpark merged commit 2874096 into apache:master Jan 18, 2025
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 21, 2025
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 5.0.0 First shipped in 5.0.0 labels Jul 29, 2025
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels packages risk:breaking-change Issues or PRs that will introduce breaking changes size/XL sqllab Namespace | Anything related to the SQL Lab 🚢 5.0.0 First shipped in 5.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants