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

feat: Improves key expiration handling in Explore #18624

Conversation

michael-s-molina
Copy link
Member

SUMMARY

The objective of this PR is to improve Explore handling when a form_data_key expires. Previously when a key expired, the user was presented with the following screen:

Screen Shot 2022-02-08 at 2 08 40 PM

To avoid this situation this PR introduces two new query parameters called slice_id and dataset_id. These parameters are used when processing an Explore request in case the form_data_key is expired. In this scenario, we recover with the minimal information necessary to present the chart, dealing with both saved and unsaved charts.

In the video below I simulate a key expiration by disabling the cache and demonstrate the changes in the workflow:

Screen.Recording.2022-02-08.at.1.42.38.PM.mov

TESTING INSTRUCTIONS

Check the video for 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 Feb 8, 2022

Codecov Report

Merging #18624 (5cc859b) into master (1fbdabd) will decrease coverage by 0.01%.
The diff coverage is 42.85%.

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18624      +/-   ##
==========================================
- Coverage   66.30%   66.29%   -0.02%     
==========================================
  Files        1595     1595              
  Lines       62632    62612      -20     
  Branches     6309     6306       -3     
==========================================
- Hits        41529    41506      -23     
- Misses      19453    19458       +5     
+ Partials     1650     1648       -2     
Flag Coverage Δ
hive 52.06% <0.00%> (-0.02%) ⬇️
javascript 51.32% <28.57%> (-0.05%) ⬇️
mysql 81.24% <71.42%> (-0.01%) ⬇️
postgres 81.29% <71.42%> (-0.01%) ⬇️
presto 51.90% <0.00%> (-0.02%) ⬇️
python 81.72% <71.42%> (-0.01%) ⬇️
sqlite 80.98% <71.42%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
.../src/dashboard/components/gridComponents/Chart.jsx 58.88% <0.00%> (ø)
...re/components/controls/DatasourceControl/index.jsx 72.36% <12.50%> (-5.90%) ⬇️
.../explore/components/ExploreViewContainer/index.jsx 56.98% <50.00%> (-0.16%) ⬇️
superset/views/core.py 77.56% <71.42%> (-0.04%) ⬇️
...dashboard/components/menu/ShareMenuItems/index.tsx 65.38% <100.00%> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 60.39% <0.00%> (ø)
...frontend/src/SqlLab/components/ResultSet/index.tsx 50.73% <0.00%> (ø)
...c/SqlLab/components/ExploreResultsButton/index.jsx
.../src/explore/components/controls/BoundsControl.jsx
.../src/explore/components/controls/BoundsControl.tsx 88.88% <0.00%> (ø)
... and 1 more

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 1fbdabd...ad6781a. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

One comment relating to making the fallback more transparent to the user. But beyond that, really great improvement! 🚀

superset/views/core.py Outdated Show resolved Hide resolved
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM!

@michael-s-molina michael-s-molina merged commit f03b4db into apache:master Feb 9, 2022
@ktmud
Copy link
Member

ktmud commented Feb 16, 2022

I'm wondering if we can encode the slice and dataset ids directly in the URL path. I.e., the explore URL becomes /explore/s/{slice_id}/{form_data_key} or /explore/d/{dataset_id}/{form_data_key}

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants