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: remove extras from all adhoc_filters controls #21450

Merged
merged 3 commits into from
Sep 13, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented Sep 13, 2022

SUMMARY

When setting native or filter box filters in a dashboard and then exploring a Mixed Timeseries chart and then saving the chart, the extra filters are only removed from the first query. This PR changes the removal logic so that all controls that start with the text adhoc_filters are cleaned from extra filters before saving. The logic is added both to the deprecated backend logic (set for removal in 3.0) and the new frontend logic which cleans the extra adhoc filters before sending the request to the v1 chart API.

AFTER

With this fix the extra filters are removed from the second query of the mixed chart (notice there are no extra filters in the adhoc filter control):
image

BEFORE

Previously saving the mixed chart with an extra filter would persist the extra filters in the chart metadata:
image

TESTING INSTRUCTIONS

  1. Create a Mixed chart
  2. Add it to a dashboard and create a native filter
  3. Apply the native filter to the chart and edit the chart
  4. Save the chart and notice that the extra filter is removed from Query A but is still present in Query B after saving.

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 Sep 13, 2022

Codecov Report

Merging #21450 (d9c3eea) into master (9c285da) will increase coverage by 0.00%.
The diff coverage is 80.00%.

❗ Current head d9c3eea differs from pull request most recent head 978519f. Consider uploading reports for the commit 978519f to get more accurate results

@@           Coverage Diff           @@
##           master   #21450   +/-   ##
=======================================
  Coverage   66.53%   66.54%           
=======================================
  Files        1791     1791           
  Lines       68599    68602    +3     
  Branches     7320     7320           
=======================================
+ Hits        45645    45648    +3     
  Misses      21064    21064           
  Partials     1890     1890           
Flag Coverage Δ
javascript 52.75% <75.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/views/core.py 75.05% <ø> (ø)
...t-frontend/src/explore/actions/saveModalActions.js 98.46% <75.00%> (+0.07%) ⬆️
superset/utils/core.py 90.00% <100.00%> (ø)

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

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.

Tested in my local then it works well! Thanks for the fixing!

@villebro villebro merged commit e1e9fda into apache:master Sep 13, 2022
@villebro villebro deleted the villebro/fix-remove-adhoc-extras branch September 13, 2022 12:52
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Sep 20, 2022
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
(cherry picked from commit e1e9fda)
@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 preset:2022.35 size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants