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


##########
superset/mcp_service/chart/chart_utils.py:
##########
@@ -916,12 +974,23 @@ def _mixed_timeseries_what(config: 
MixedTimeseriesChartConfig) -> str:
     return f"{primary} + {secondary}"
 
 
+def _big_number_chart_what(config: BigNumberChartConfig) -> str:
+    """Build the 'what' portion for a big number chart name."""
+    metric_label = (
+        config.metric.label or 
f"{config.metric.aggregate}({config.metric.name})"
+    )

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect chart name when aggregate is None</b></div>
   <div id="fix">
   
   In _big_number_chart_what, if config.metric.aggregate is None, the chart 
name will incorrectly display 'None(name)' instead of a proper metric label. 
This should default to 'SUM' and be uppercased to match the behavior in 
create_metric_object.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       metric_label = (
           config.metric.label or f"{(config.metric.aggregate or 
'SUM').upper()}({config.metric.name})"
       )
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f6f0f7</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