Skip to content

fix(chart): stop duplicate metrics when switching between Waterfall and other chart types - #42533

Merged
rusackas merged 2 commits into
masterfrom
fix/issue-32835-suggested-open-pr-test-first-v3
Aug 3, 2026
Merged

rusackas merged 2 commits into
masterfrom
fix/issue-32835-suggested-open-pr-test-first-v3

Conversation

@rusackas

Copy link
Copy Markdown
Member

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:

  1. Switching from e.g. Line (metrics: [A, B]) to Waterfall queued [A, B] but never shifted anything out.
  2. Whatever metric the user ended up with on Waterfall got pushed back onto the (still full) queue.
  3. Switching back to Line popped the whole queue, producing [metric_from_waterfall, A, B] — duplicate measures.

This PR adds the standard formDataOverrides to 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

  1. Create a chart with a Line viz and two metrics (e.g. COUNT(*) and SUM(some_column)).
  2. Switch the viz type to Waterfall.
  3. Switch back to Line.
  4. Before this fix: the metrics list would contain a duplicate. After this fix: the original two metrics are preserved with no duplication.

Also added a unit test (plugins/plugin-chart-echarts/test/Waterfall/controlPanel.test.ts) pinning that Waterfall's formDataOverrides consumes a single metric and all queued columns from getStandardizedControls().

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Duplicate measures appear when switching between chart types #32835
  • 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

…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]>
@dosubot dosubot Bot added change:frontend Requires changing the frontend explore:metrics Related to metrics of Explore labels Jul 28, 2026
@bito-code-review

bito-code-review Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #182866

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 7cd415c..7cd415c
    • superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/controlPanel.test.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.27%. Comparing base (ecc7f72) to head (ff230c5).
⚠️ Report is 108 commits behind head on master.

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           
Flag Coverage Δ
javascript 71.36% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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]>
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit ff230c5
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a6d30ae1ba2a10008172d73
😎 Deploy Preview https://deploy-preview-42533--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #087a3c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 7cd415c..ff230c5
    • superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/controlPanel.test.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas
rusackas merged commit 566d23e into master Aug 3, 2026
67 checks passed
@rusackas
rusackas deleted the fix/issue-32835-suggested-open-pr-test-first-v3 branch August 3, 2026 16:22
gkneighb pushed a commit to gkneighb/superset that referenced this pull request Aug 4, 2026
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]>
gkneighb pushed a commit to gkneighb/superset that referenced this pull request Aug 5, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend explore:metrics Related to metrics of Explore plugins size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate measures appear when switching between chart types

3 participants