bito-code-review[bot] commented on code in PR #37217:
URL: https://github.com/apache/superset/pull/37217#discussion_r2699910772


##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -400,10 +402,12 @@ export default function transformProps(
 
     if (groupby.length > 0) {
       // When we have groupby, format as "metric, dimension"
-      const metricPart = showQueryIdentifiers
+      const metricPart: string = showQueryIdentifiers
         ? `${MetricDisplayNameA} (Query A)`
         : MetricDisplayNameA;
-      displayName = `${metricPart}, ${entryName}`;
+      displayName = entryName.includes(metricPart)
+        ? entryName
+        : `${metricPart}, ${entryName}`;

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Logic bug in display name duplication check</b></div>
   <div id="fix">
   
   The includes check should use MetricDisplayNameA instead of metricPart to 
correctly detect duplicates based on the raw metric name, updating the 
conditional expression accordingly.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2c69e9</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -471,10 +475,12 @@ export default function transformProps(
 
     if (groupbyB.length > 0) {
       // When we have groupby, format as "metric, dimension"
-      const metricPart = showQueryIdentifiers
+      const metricPart: string = showQueryIdentifiers
         ? `${MetricDisplayNameB} (Query B)`
         : MetricDisplayNameB;
-      displayName = `${metricPart}, ${entryName}`;
+      displayName = entryName.includes(metricPart)

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Logic bug in display name duplication check</b></div>
   <div id="fix">
   
   Similar to Query A, the includes check should use MetricDisplayNameB instead 
of metricPart to avoid duplication in display names when showQueryIdentifiers 
is true.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
         displayName = entryName.includes(MetricDisplayNameB)
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2c69e9</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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]

Reply via email to