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/26 00:27:38 UTC
[PR] fix(table): pick totals query positionally so all_records percent metrics don't shift it [superset]
rusackas opened a new pull request, #42428:
URL: https://github.com/apache/superset/pull/42428
### SUMMARY
When "Percentage metric calculation" is set to "Use all records" and "Show totals" is enabled, `buildQuery` inserts an extra query (used to compute percent metrics against the full result set) *ahead* of the totals query inside `queriesData`. `transformProps` picked the totals query by a fixed array index, so in this configuration it grabbed the percent-metrics-only query instead, and the summary/totals row ended up with the wrong values (and, since those values didn't line up with the columns' configured `d3NumberFormat`, effectively unformatted-looking numbers).
This locates the totals query positionally (it's always the last entry in `queriesData` when present) instead of assuming a fixed index, so it's no longer displaced by the extra percent-metrics query.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable — logic fix in query result wiring, not a visual/styling change.
### TESTING INSTRUCTIONS
1. Create a Table chart in Aggregate mode with at least one metric and a percent metric.
2. Set "Percentage metric calculation" to "Use all records".
3. Enable "Show totals".
4. Set a custom number format on a metric column via "Customize columns".
5. Confirm the summary/totals row now reflects the correct total (and format) for that column, rather than a value pulled from the percent-metrics query.
Also covered by a new unit test in `superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx` that pins down the correct `totals` query is picked when the "all records" percent-metric query precedes it in `queriesData`.
Note: I wasn't able to run the frontend test suite in this environment (broken/hanging local `node_modules`), so please treat CI as the source of truth here.
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #39587
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] 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(table): pick totals query positionally so all_records percent metrics don't shift it [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42428:
URL: https://github.com/apache/superset/pull/42428#issuecomment-5081204773
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(table): pick totals query positionally so all_records percent metrics don't shift it [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #42428:
URL: https://github.com/apache/superset/pull/42428
--
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(table): pick totals query positionally so all_records percent metrics don't shift it [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42428:
URL: https://github.com/apache/superset/pull/42428#issuecomment-5081502652
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42428?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.24%. Comparing base ([`e1ffa53`](https://app.codecov.io/gh/apache/superset/commit/e1ffa53d9b4926f2ac7fe8c83c5f890fd621f3c8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0bde9a7`](https://app.codecov.io/gh/apache/superset/commit/0bde9a7f2899b360d1fc9cb31cd250c968078514?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 2 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #42428 +/- ##
=======================================
Coverage 65.24% 65.24%
=======================================
Files 2795 2795
Lines 157643 157649 +6
Branches 36061 36066 +5
=======================================
+ Hits 102853 102859 +6
Misses 52814 52814
Partials 1976 1976
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/42428/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/42428/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.27% <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/42428?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(table): pick totals query positionally so all_records percent metrics don't shift it [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42428:
URL: https://github.com/apache/superset/pull/42428#issuecomment-5082074327
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