Repository navigation
fix(chart): stop duplicate metrics when switching between Waterfall and other chart types - #42533
Conversation
…nd other chart types The Waterfall control panel never drained the shared standardized-controls metric/column queue on viz-type switch (no formDataOverrides), so metrics picked up when entering Waterfall stayed queued and got re-applied on top of the original ones when switching back to a multi-metric chart (e.g. Line), producing duplicate measures. Add the same formDataOverrides pattern used by the other single-metric echarts charts (Pie, Gauge, Sunburst, etc.) so Waterfall shifts exactly one metric and pops all columns from the queue. Fixes #32835 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Code Review Agent Run #182866Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42533 +/- ##
=======================================
Coverage 65.27% 65.27%
=======================================
Files 2795 2795
Lines 157835 157836 +1
Branches 36080 36080
=======================================
+ Hits 103024 103025 +1
Misses 52818 52818
Partials 1993 1993
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…opping the whole queue Waterfall's groupby control is multi: false, but formDataOverrides was using popAllColumns() to fill it, borrowed from multi-groupby charts like Pie. That let a memorized multi-column breakdown (e.g. from a Table or Pivot) push every queued column into groupby: buildQuery groups by the entire array while transformProps only reads groupby[0], so the chart silently queries at a finer grain than it renders. Use shiftColumn() instead, matching the single-value shiftMetric() pattern already used for metric. Co-Authored-By: Claude Opus 4.8 <[email protected]>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #087a3cActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Master added test/Waterfall/controlPanel.test.ts in apache#42533; rename the x-axis-sort control test to controlPanel.sort.test.ts so the two files no longer collide (add/add conflict). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Master added test/Waterfall/controlPanel.test.ts in apache#42533; rename the x-axis-sort control test to controlPanel.sort.test.ts so the two files no longer collide (add/add conflict). Co-Authored-By: Claude Opus 4.8 <[email protected]>
SUMMARY
The Waterfall control panel never defined
formDataOverrides, so it never drained the shared "standardized controls" metric/column queue that Explore uses to hand off metrics/columns between viz types on switch.Every other single-metric echarts chart (Pie, Gauge, Sunburst, Radar, BigNumber, etc.) consumes exactly one metric from that queue via
getStandardizedControls().shiftMetric(). Waterfall skipped this, so:metrics: [A, B]) to Waterfall queued[A, B]but never shifted anything out.[metric_from_waterfall, A, B]— duplicate measures.This PR adds the standard
formDataOverridesto the Waterfall control panel so it shifts a single metric and pops all columns from the queue, matching the pattern used everywhere else.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — this is a form-data plumbing fix, not a rendering change. See the repro steps in #32835 and the linked video from @msyavuz there.
TESTING INSTRUCTIONS
COUNT(*)andSUM(some_column)).Also added a unit test (
plugins/plugin-chart-echarts/test/Waterfall/controlPanel.test.ts) pinning that Waterfall'sformDataOverridesconsumes a single metric and all queued columns fromgetStandardizedControls().ADDITIONAL INFORMATION