bito-code-review[bot] commented on code in PR #41923:
URL: https://github.com/apache/superset/pull/41923#discussion_r3562557577
##########
superset/mcp_service/chart/tool/generate_chart.py:
##########
@@ -886,14 +886,9 @@ async def generate_chart( # noqa: C901
logger.exception("Chart generation failed: %s", str(e))
- # Extract chart_type from different sources for better error context
+ # request.config is always a validated ChartConfig (never a dict), so
+ # chart_type context isn't extractable here.
chart_type = "unknown"
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Error context regression</b></div>
<div id="fix">
The exception handler can access `request.config.chart_type` directly since
request parsing completed successfully before this handler is reached.
Hardcoding "unknown" removes valuable context from error messages. Use
`request.config.chart_type` to provide specific chart type in error reporting.
</div>
</div>
<small><i>Code Review Run #df3a26</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]