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(native filter): clean deleted parent filter ids #24749

Conversation

justinpark
Copy link
Member

SUMMARY

When a parent filter has been removed, the cascadingParentIds has not updated accordingly.
This regression caused by the redux state mutation migration which remains filterConfigMap in obsolete dependency metadata because the redux action will update state.nativeFilters whereas filterConfigMap references from state.dashboardInfo.metadata.native_filter_configuration

This commit updates the cleanDeletedParents logic to retrieve the updated filterConfigMap data and then pass to the onSave payload in order to sync the latest updates.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After:

after--deleted-parent-id.mov

Before:

before--deleted-parent-id.mov

TESTING INSTRUCTIONS

Create a native filter and links a dependent filter
Hit save and then edit the native filter again
Remove the dependent filter only and then save
mouse over the filter has the dependent filter and see an error

ADDITIONAL INFORMATION

@john-bodley
Copy link
Member

john-bodley commented Jul 20, 2023

Thanks @justinpark for the fix. I pushed a commit which includes a migration to remedy any corrupted dashboards. It would be good to verify said change in your environment.

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #24749 (82455a5) into master (1a97245) will increase coverage by 0.04%.
The diff coverage is 88.88%.

❗ Current head 82455a5 differs from pull request most recent head b290341. Consider uploading reports for the commit b290341 to get more accurate results

@@            Coverage Diff             @@
##           master   #24749      +/-   ##
==========================================
+ Coverage   68.89%   68.93%   +0.04%     
==========================================
  Files        1901     1901              
  Lines       73925    73925              
  Branches     8183     8182       -1     
==========================================
+ Hits        50931    50963      +32     
+ Misses      20873    20848      -25     
+ Partials     2121     2114       -7     
Flag Coverage Δ
hive 54.16% <ø> (ø)
javascript 55.79% <88.88%> (+0.08%) ⬆️
mysql 79.21% <ø> (ø)
postgres 79.30% <ø> (ø)
presto 54.06% <ø> (ø)
python 83.32% <ø> (ø)
sqlite 77.88% <ø> (ø)
unit 54.88% <ø> (ø)

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

Impacted Files Coverage Δ
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 71.85% <88.88%> (+8.04%) ⬆️

... and 5 files with indirect coverage changes

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

@john-bodley john-bodley force-pushed the fix--native-filter-remove-deleted-parent-filter-id branch from bb96a73 to 08c9eca Compare July 20, 2023 00:34
@john-bodley john-bodley force-pushed the fix--native-filter-remove-deleted-parent-filter-id branch from 08c9eca to b290341 Compare July 20, 2023 00:35
Copy link
Member

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

Choose a reason for hiding this comment

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

LGTM. Thank you for the fix and added tests!

@justinpark
Copy link
Member Author

Thanks justinpark for the fix. I pushed a commit which includes a migration to remedy any corrupted dashboards. It would be good to verify said change in your environment.

Confirmed the migration script worked well and the corrupted cascadingParentIds has been cleaned.

@john-bodley john-bodley added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 20, 2023
@john-bodley
Copy link
Member

FYI @eschutho I wonder if you want to cherry-pick this into 2.1.1. Note there's a DB migration and thus you'll have to handle the version.

@justinpark justinpark merged commit 4086514 into apache:master Jul 20, 2023
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Jul 20, 2023
Co-authored-by: John Bodley <john.bodley@gmail.com>
(cherry picked from commit 4086514)
michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
Co-authored-by: John Bodley <john.bodley@gmail.com>
(cherry picked from commit 4086514)
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Co-authored-by: John Bodley <john.bodley@gmail.com>
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/L v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants