codeant-ai-for-open-source[bot] commented on code in PR #37229:
URL: https://github.com/apache/superset/pull/37229#discussion_r3677215911
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -211,6 +212,8 @@ export default function transformProps(
detected_currency: backendDetectedCurrency,
} = queryData as TimeseriesChartDataResponseResult;
+ const verboseMap = addLabelMapToVerboseMap(label_map, originalVerboseMap);
Review Comment:
**Suggestion:** Adding generated compound-name entries to `verboseMap` can
create duplicate display values for different raw series. The later
`invert(verboseMap)` lookup retains only one raw key for each display value, so
when two metrics or dimension combinations resolve to the same human-readable
name, the other series can resolve to the wrong backend key and receive
incorrect label, color, or formatter metadata. Preserve raw-key identity when
resolving display names rather than relying on an inverted map with lossy
duplicate handling. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Colliding metrics can overwrite rebased series data.
- ⚠️ Series colors may use another metric's identity.
- ⚠️ Tooltip formatters can resolve incorrect metric metadata.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8b861d4d7dbe4ac8b1fdf9438dbb38bc&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=8b861d4d7dbe4ac8b1fdf9438dbb38bc&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:** 215:215
**Comment:**
*Logic Error: Adding generated compound-name entries to `verboseMap`
can create duplicate display values for different raw series. The later
`invert(verboseMap)` lookup retains only one raw key for each display value, so
when two metrics or dimension combinations resolve to the same human-readable
name, the other series can resolve to the wrong backend key and receive
incorrect label, color, or formatter metadata. Preserve raw-key identity when
resolving display names rather than relying on an inverted map with lossy
duplicate handling.
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%2F37229&comment_hash=ce3917ee5dedfa14222d889383b6090282159a02ca89ac421790965a1bc95627&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37229&comment_hash=ce3917ee5dedfa14222d889383b6090282159a02ca89ac421790965a1bc95627&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]