-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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(explore): Metrics disappearing after removing metric from dataset #17201
fix(explore): Metrics disappearing after removing metric from dataset #17201
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17201 +/- ##
==========================================
+ Coverage 77.02% 77.07% +0.04%
==========================================
Files 1037 1037
Lines 55629 55642 +13
Branches 7594 7599 +5
==========================================
+ Hits 42850 42887 +37
+ Misses 12529 12505 -24
Partials 250 250
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@kgabryje thanks so much for the fix! but in airbnb we didn't enable explore view's drag-n-drop. this fix didn't apply to us 😢 |
5970f04
to
873c95f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, especially the new test cases! Would be really nice to have type guards to distinguish saved from adhoc metrics, but those need to be addressed after monorepo is finished. A todo might be nice, but not mandatory IMO.
@graceguo-supercat Thanks for pointing that out! I updated the PR with fix for non-dnd controls. Would you mind checking it out? |
Hi @kgabryje thanks for the work! with the latest fix, non-dnd controls work good. But here i have another question for this solution. In the current workflow, when front-end found any invalid in the above example, Ideally, Superset should let user know which piece of data is not valid anymore, and ask user to take action to clean up this bad data. right? cc @villebro @john-bodley @junlincc for suggestions |
a8a3003
to
68ce444
Compare
Thanks for reviewing Grace! I feel like your proposed change might require some PM and/or designer attention - let's continue the discussion in the issue you created |
4a01629
to
6cfb6b2
Compare
6cfb6b2
to
5353aa2
Compare
…#17201) * fix(explore): Metrics disappearing after removing metric from dataset * fix test * Apply fix to non-dnd controls * Make adhoc metrics pick up changes from dataset columns * Remove console log * Fix bug in nondnd controls
SUMMARY
Before, when a custom metric that was currently selected got removed from dataset, all selected metrics where cleared and user had to rebuild their chart.
This PR fixes that behaviour by removing from metrics picker only those custom metrics that were removed from dataset. Also, if user removes a column from dataset, the adhoc metrics that use that column will also be removed.
Also, it fixes another bug that's been around for long time - now adhoc metric labels display column's verbose name as a default label rather than it's name from database.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: see linked issue
After:
Screen.Recording.2021-10-22.at.18.50.35.mov
TESTING INSTRUCTIONS
Follow the reproduction steps from linked issue, make sure that only the metric that got removed from dataset is removed from metrics picker.
ADDITIONAL INFORMATION
CC @graceguo-supercat @rusackas @junlincc