codeant-ai-for-open-source[bot] commented on code in PR #45555:
URL: https://github.com/apache/superset/pull/45555#discussion_r4333288641
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -544,7 +546,24 @@ export default function transformProps(
let displayName: string;
- if (groupby.length > 0) {
+ if (truncateMetric && groupby.length > 0) {
+ // Drop the metric part entirely and show only the groupby/dimension
+ // values, same metric-vs-dimension split the branch below uses: the
+ // label-map tuple is [metric, ...dimensions] when it has more than
+ // one entry, otherwise the whole tuple is the dimension (no metric
+ // index at all). Still apply the query-identifier suffix when asked
+ // for, or Query A and Query B become indistinguishable whenever they
+ // share a groupby value (#38451).
+ const groupbyValues =
+ labelMapValues && labelMapValues.length > 1
+ ? labelMapValues.slice(1)
+ : (labelMapValues ?? []);
+ const truncatedName =
+ groupbyValues.length > 0 ? groupbyValues.join(', ') : entryName;
+ displayName = showQueryIdentifiers
+ ? `${truncatedName} (Query A)`
+ : truncatedName;
Review Comment:
**Suggestion:** With multiple metrics, series sharing a groupby value get
identical names, so the later series overwrites the earlier seriesβ
cross-filter label-map entry.
**Assessment:** π `Major` Β· π `Occurrence: Sometimes` Β· π·οΈ `Incorrect
condition logic`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=fc9b44ed0c9a4c328a54a6aed6540fb1&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=fc9b44ed0c9a4c328a54a6aed6540fb1&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-echarts/src/MixedTimeseries/transformProps.ts
**Line:** 561:565
**Comment:**
*Incorrect Condition Logic: With multiple metrics, series sharing a
groupby value get identical names, so the later series overwrites the earlier
seriesβ cross-filter label-map entry.
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%2F45555&comment_hash=9626eb4988faed9b50cc50beeb09ea226bb0c9a61b09b1bcab70e7ec31797f3c&reaction=like'>π</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45555&comment_hash=9626eb4988faed9b50cc50beeb09ea226bb0c9a61b09b1bcab70e7ec31797f3c&reaction=dislike'>π</a>
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -544,7 +546,24 @@ export default function transformProps(
let displayName: string;
- if (groupby.length > 0) {
+ if (truncateMetric && groupby.length > 0) {
+ // Drop the metric part entirely and show only the groupby/dimension
+ // values, same metric-vs-dimension split the branch below uses: the
+ // label-map tuple is [metric, ...dimensions] when it has more than
+ // one entry, otherwise the whole tuple is the dimension (no metric
+ // index at all). Still apply the query-identifier suffix when asked
+ // for, or Query A and Query B become indistinguishable whenever they
+ // share a groupby value (#38451).
+ const groupbyValues =
+ labelMapValues && labelMapValues.length > 1
+ ? labelMapValues.slice(1)
+ : (labelMapValues ?? []);
Review Comment:
**Suggestion:** With one metric and multiple group-by columns, the tuple
contains only dimension values; slicing its first value drops a dimension and
gives distinct groups the same name.
**Assessment:** π `Major` Β· π `Occurrence: Sometimes` Β· π·οΈ `Incorrect
condition logic`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a8c92cd6992b4895b95dc0ca30a19e42&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=a8c92cd6992b4895b95dc0ca30a19e42&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-echarts/src/MixedTimeseries/transformProps.ts
**Line:** 557:560
**Comment:**
*Incorrect Condition Logic: With one metric and multiple group-by
columns, the tuple contains only dimension values; slicing its first value
drops a dimension and gives distinct groups the same name.
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%2F45555&comment_hash=fe181a450899362e63a58b28ae40471a6eb7b3e2648b2de1a92c814f036638c6&reaction=like'>π</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45555&comment_hash=fe181a450899362e63a58b28ae40471a6eb7b3e2648b2de1a92c814f036638c6&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]