superset icon indicating copy to clipboard operation
superset copied to clipboard

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

Open justinpark opened this issue 1 year ago • 6 comments

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

https://github.com/apache/superset/assets/1392866/d9076897-efcb-4a43-b1d2-4fa4c2d6a139

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
  • [x] Introduces new feature or API
  • [ ] Removes existing feature or API

justinpark avatar Jun 10 '24 20:06 justinpark

Codecov Report

Attention: 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 1334 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/sql_lab/permalink/get.py 70.27% 11 Missing :warning:
superset/sqllab/permalink/api.py 90.19% 5 Missing :warning:
superset/commands/sql_lab/permalink/create.py 88.00% 3 Missing :warning:
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.84% <67.74%> (-0.32%) :arrow_down:
javascript ?
mysql 76.03% <87.74%> (?)
postgres 76.09% <87.74%> (?)
presto 53.34% <67.74%> (-0.46%) :arrow_down:
python 83.45% <87.74%> (+19.97%) :arrow_up:
sqlite 75.57% <87.74%> (?)
unit 61.06% <67.74%> (+3.44%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 10 '24 20:06 codecov[bot]

/testenv up

villebro avatar Jun 20 '24 13:06 villebro

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

github-actions[bot] avatar Jun 20 '24 13:06 github-actions[bot]

/testenv up FEATURE_SHARE_QUERIES_VIA_KV_STORE=true

villebro avatar Jun 21 '24 07:06 villebro

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

github-actions[bot] avatar Jun 21 '24 07:06 github-actions[bot]

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.

michael-s-molina avatar Jun 21 '24 11:06 michael-s-molina

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

justinpark avatar Jul 23 '24 21:07 justinpark

Can you add support for old saved query URLs?

michael-s-molina avatar Jul 25 '24 17:07 michael-s-molina

Can you add support for old saved query URLs?

Done. @michael-s-molina PTAL

justinpark avatar Jan 13 '25 23:01 justinpark