codeant-ai-for-open-source[bot] commented on code in PR #45555:
URL: https://github.com/apache/superset/pull/45555#discussion_r4334914634
##########
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:
✅ **Customized review instruction saved!**
**Instruction:**
> Do not flag series-name collisions caused by intentionally hiding metrics
when the opt-in setting is enabled; users can disable the setting to
distinguish metrics.
**Applied to:**
-
`superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]