codeant-ai-for-open-source[bot] commented on code in PR #43481:
URL: https://github.com/apache/superset/pull/43481#discussion_r3846268541
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -145,6 +155,13 @@ export default function transformProps(chartProps:
ChartProps<QueryFormData>) {
data: splitRows[i] as DataRecord[],
groupby: combination,
}));
+ // This result *does* carry the rollup levels, so pick out the leaf level
--
+ // the one grouping every dimension, same definition the splitter uses.
+ const leafIndex = levelLabels.findIndex(labels => {
+ const grouped = new Set(labels);
+ return allGroupbyLabels.every(label => grouped.has(label));
+ });
+ colorScaleRows = (splitRows[leafIndex] as DataRecord[]) ?? [];
Review Comment:
**Suggestion:** The formatter domain now contains only leaf rows, but
subtotal values are still passed through `getCellColor` in `TableRenderers` as
ordinary value cells. For the `None` comparator, a subtotal larger than the
leaf maximum fails `value <= extremeValue`, so it receives no conditional
formatting even though subtotals were previously colored. Either exclude
subtotal cells from formatter usage or include the rendered subtotal values in
the domain while preventing them from determining the detail scale. [logic
error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Non-additive pivot subtotals can lose conditional formatting.
- ⚠️ `pvtVal` subtotal cells still invoke `getCellColor()`.
- ⚠️ Detail-cell scaling fix changes existing subtotal appearance.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e53b36e356f24f7da1c74cba0a79cb04&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e53b36e356f24f7da1c74cba0a79cb04&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts
**Line:** 164:164
**Comment:**
*Logic Error: The formatter domain now contains only leaf rows, but
subtotal values are still passed through `getCellColor` in `TableRenderers` as
ordinary value cells. For the `None` comparator, a subtotal larger than the
leaf maximum fails `value <= extremeValue`, so it receives no conditional
formatting even though subtotals were previously colored. Either exclude
subtotal cells from formatter usage or include the rendered subtotal values in
the domain while preventing them from determining the detail scale.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43481&comment_hash=24f9ae3af64bfc32f11ab7945b676804621caf82f79efa3ced02e2c6d7429ff9&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43481&comment_hash=24f9ae3af64bfc32f11ab7945b676804621caf82f79efa3ced02e2c6d7429ff9&reaction=dislike'>👎</a>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]