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

fix: Supports form_data param in old Explore endpoint #21469

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

This PR improves the support for the form_data param in the old /superset/explore endpoint. Previously, the old endpoint only redirected the user to the new endpoint with the same original request parameters. Now, if form_data is present, the endpoint will persist that information in the cache and replace the parameter with form_data_key, the new supported format.

Example:

GET /superset/explore/?form_data=<object>

will be redirected to

GET /explore/?form_data_key=<key>

TESTING INSTRUCTIONS

Check that GET requests to the old endpoint are correctly redirected to the new endpoint with the correct parameters.

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

superset/views/core.py Outdated Show resolved Hide resolved
url = parse.urlparse(redirect_url)
query = parse.parse_qs(url.query)
query.pop("form_data")
query["form_data_key"] = [form_data_key]
Copy link
Member

Choose a reason for hiding this comment

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

Why this this an array?

Copy link
Member Author

Choose a reason for hiding this comment

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

From urllib.parse

The dictionary keys are the unique query variable names and the values are lists of values for each name.

It's because most web frameworks allow multiple values to be associated with a single field.

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Merging #21469 (c95e5a0) into master (59ca786) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #21469   +/-   ##
=======================================
  Coverage   66.59%   66.60%           
=======================================
  Files        1791     1791           
  Lines       68555    68577   +22     
  Branches     7319     7319           
=======================================
+ Hits        45654    45673   +19     
- Misses      21008    21011    +3     
  Partials     1893     1893           
Flag Coverage Δ
hive 53.04% <13.04%> (-0.03%) ⬇️
mysql 78.18% <100.00%> (+0.01%) ⬆️
postgres 78.24% <100.00%> (+<0.01%) ⬆️
presto 52.94% <13.04%> (-0.03%) ⬇️
python 81.38% <100.00%> (+<0.01%) ⬆️
sqlite 76.74% <100.00%> (+0.01%) ⬆️
unit 51.04% <13.04%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
superset/views/core.py 76.04% <100.00%> (+0.48%) ⬆️
superset/reports/commands/log_prune.py 85.71% <0.00%> (-3.58%) ⬇️
superset/commands/importers/v1/utils.py 92.20% <0.00%> (-1.30%) ⬇️
superset/common/query_object.py 93.87% <0.00%> (-0.52%) ⬇️
superset/reports/commands/execute.py 91.19% <0.00%> (-0.36%) ⬇️

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

@michael-s-molina michael-s-molina merged commit 2c7323a into apache:master Sep 14, 2022
justinpark pushed a commit to airbnb/superset-fork that referenced this pull request Sep 16, 2022
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Sep 19, 2022
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Sep 20, 2022
@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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants