codeant-ai-for-open-source[bot] commented on code in PR #42881:
URL: https://github.com/apache/superset/pull/42881#discussion_r3733957999
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -318,18 +318,19 @@ export default function transformProps(
rebaseToPercentChange(forecastRebasedData, xAxisLabel || DTTM_ALIAS)
: forecastRebasedData;
const isHorizontal = orientation === OrientationType.Horizontal;
+ const extraMetricLabels = extractExtraMetrics(chartProps.rawFormData).map(
+ getMetricLabel,
+ );
Review Comment:
**Suggestion:** `extraMetricLabels` is built from raw metric labels, but
`rebasedData` has already been passed through `rebaseForecastDatum`, which
renames keys using `verboseMap`. When the sort-only metric has a verbose label,
the exclusion set contains the raw label while the data row contains the
verbose label, so the sort metric is still included in `totalStackedValues`.
Build the exclusions using the same post-rebase labels, or apply the mapping
before passing them to `extractDataTotalValues`. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Stacked totals remain inflated with verbose metric labels.
- ⚠️ Show Total displays values absent from rendered metrics.
- ⚠️ Only Total annotations use incorrect aggregate values.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=154e99fe9b294377b860f6b8cca1ea57&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=154e99fe9b294377b860f6b8cca1ea57&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<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-echarts/src/Timeseries/transformProps.ts
**Line:** 321:323
**Comment:**
*Api Mismatch: `extraMetricLabels` is built from raw metric labels, but
`rebasedData` has already been passed through `rebaseForecastDatum`, which
renames keys using `verboseMap`. When the sort-only metric has a verbose label,
the exclusion set contains the raw label while the data row contains the
verbose label, so the sort metric is still included in `totalStackedValues`.
Build the exclusions using the same post-rebase labels, or apply the mapping
before passing them to `extractDataTotalValues`.
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%2F42881&comment_hash=e3c3518d2ce3d5f00f14400866d1271e66b70b1d59ce81dfb5d7a51e28b09245&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42881&comment_hash=e3c3518d2ce3d5f00f14400866d1271e66b70b1d59ce81dfb5d7a51e28b09245&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]