codeant-ai-for-open-source[bot] commented on code in PR #42755:
URL: https://github.com/apache/superset/pull/42755#discussion_r3713693931
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -304,18 +304,19 @@ export default function transformProps(
xAxisLabel = verboseMap[xAxisLabel];
}
const isHorizontal = orientation === OrientationType.Horizontal;
+ const extraMetricLabels = extractExtraMetrics(chartProps.rawFormData).map(
+ getMetricLabel,
+ );
Review Comment:
**Suggestion:** `extraMetricLabels` contains raw query metric labels, but
`rebasedData` uses keys normalized by `rebaseForecastDatum`, including
`verboseMap` display names and time-comparison suffixes. When the series-limit
metric is verbose-mapped or time-compared, `excludedKeys.has(curr)` will not
match its actual data key, so the supposedly hidden metric still contributes to
`totalStackedValues` (and the same labels also fail to exclude it from
`extractSeries`). Normalize the extra labels using the same key transformation
as the data before passing them to both helpers. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Displayed stacked totals include hidden sort metrics.
- ❌ Hidden metrics can reappear in rendered series.
- ⚠️ Time-comparison totals use mismatched metric keys.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f983e5c6412d45568898fdda9e8844bb&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=f983e5c6412d45568898fdda9e8844bb&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:** 307:309
**Comment:**
*Api Mismatch: `extraMetricLabels` contains raw query metric labels,
but `rebasedData` uses keys normalized by `rebaseForecastDatum`, including
`verboseMap` display names and time-comparison suffixes. When the series-limit
metric is verbose-mapped or time-compared, `excludedKeys.has(curr)` will not
match its actual data key, so the supposedly hidden metric still contributes to
`totalStackedValues` (and the same labels also fail to exclude it from
`extractSeries`). Normalize the extra labels using the same key transformation
as the data before passing them to both helpers.
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%2F42755&comment_hash=c7cc14f8044a0d90b45fdda5e90647e34f7fec648c8df9527f41f53ad3243128&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42755&comment_hash=c7cc14f8044a0d90b45fdda5e90647e34f7fec648c8df9527f41f53ad3243128&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]