You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/07/28 10:26:14 UTC
[PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
rusackas opened a new pull request, #42533:
URL: https://github.com/apache/superset/pull/42533
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### 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
- [x] Has associated issue: Fixes #32835
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42533:
URL: https://github.com/apache/superset/pull/42533#issuecomment-5149300168
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #42533:
URL: https://github.com/apache/superset/pull/42533#discussion_r3687092529
##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -245,6 +246,11 @@ const config: ControlPanelConfig = {
multi: false,
},
},
+ formDataOverrides: formData => ({
+ ...formData,
+ metric: getStandardizedControls().shiftMetric(),
Review Comment:
If a Line chart has metrics A and B, switching to Waterfall leaves B queued; choosing B in Waterfall and switching back then collects the active B plus the queued B, so Line still receives duplicate metrics. Could this reconcile the active Waterfall metric with the queued metrics and cover that edit path with a real Line → Waterfall → Line regression test?
##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -245,6 +246,11 @@ const config: ControlPanelConfig = {
multi: false,
},
},
+ formDataOverrides: formData => ({
+ ...formData,
+ metric: getStandardizedControls().shiftMetric(),
+ groupby: getStandardizedControls().popAllColumns(),
Review Comment:
Waterfall declares `groupby` as `multi: false`, but this can overwrite a memorized single breakdown with every dimension accumulated in another chart. `buildQuery` groups by all of them while `transformProps` reads only `groupby[0]`, so returning from a Table/Pivot with multiple dimensions silently queries finer granularity than it renders. Should this transfer only one column and leave the rest queued?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42533:
URL: https://github.com/apache/superset/pull/42533#issuecomment-5103146116
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42533?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 65.27%. Comparing base ([`ecc7f72`](https://app.codecov.io/gh/apache/superset/commit/ecc7f726a4ea2694ed888bcc2429624f3d4c3f1e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7cd415c`](https://app.codecov.io/gh/apache/superset/commit/7cd415c4af4267fc40767254c1d9f0403434aca3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #42533 +/- ##
=======================================
Coverage 65.26% 65.27%
=======================================
Files 2795 2795
Lines 157835 157836 +1
Branches 36080 36080
=======================================
+ Hits 103018 103025 +7
+ Misses 52824 52818 -6
Partials 1993 1993
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/42533/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/42533/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.36% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42533?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42533:
URL: https://github.com/apache/superset/pull/42533#issuecomment-5102944258
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42533:
URL: https://github.com/apache/superset/pull/42533#discussion_r3693933509
##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -245,6 +246,11 @@ const config: ControlPanelConfig = {
multi: false,
},
},
+ formDataOverrides: formData => ({
+ ...formData,
+ metric: getStandardizedControls().shiftMetric(),
+ groupby: getStandardizedControls().popAllColumns(),
Review Comment:
@sadpandajoe good catch, fixed! Swapped popAllColumns() for shiftColumn() (wrapped in ensureIsArray so groupby keeps its array type) so only one column comes off the queue here, same as the single-value shiftMetric() already used for metric.
##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -245,6 +246,11 @@ const config: ControlPanelConfig = {
multi: false,
},
},
+ formDataOverrides: formData => ({
+ ...formData,
+ metric: getStandardizedControls().shiftMetric(),
Review Comment:
@sadpandajoe good catch on the scenario, but I think this gap lives in the standardizedControls framework itself, not Waterfall specifically. Pie, Gauge, Sunburst, and the rest all use the same shiftMetric()/queue pattern, so any of them would reproduce this if you hand-edit the metric instead of switching viz types again. Fixing it right means touching StandardizedFormData.getStandardizedControls(), not this control panel, so that feels like a follow-up issue rather than scope for this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42533:
URL: https://github.com/apache/superset/pull/42533#issuecomment-5148343205
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | ff230c575b1346202cf5c49b993ea0ab8d987e25 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a6d30ae1ba2a10008172d73 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42533--superset-docs-preview.netlify.app](https://deploy-preview-42533--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DYvBDcIwDAB38RuLJBZtxQaM4WK3RILGStIKhNgdf053j_uC1fKyDleAE8yVt_vDfcnvc25tV6Q00QXbvq7augoW0w2tYvfEJVfnQb6K2rN8buLzwINQYI0zJ44hhCmOSUaC3x8) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-42533--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart): stop duplicate metrics when switching between Waterfall and other chart types [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #42533:
URL: https://github.com/apache/superset/pull/42533
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org