bito-code-review[bot] commented on code in PR #41923:
URL: https://github.com/apache/superset/pull/41923#discussion_r3589096487
##########
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:
<!-- Bito Reply -->
The suggestion provided by the reviewer was appropriate and has been
successfully addressed. By replacing the hardcoded "unknown" value with the
validated `request.config.chart_type`, the error handling now provides more
accurate and useful context when chart generation fails.
**superset/mcp_service/chart/tool/generate_chart.py**
```
# request.config is always a validated ChartConfig (never a dict), so
# chart_type context isn't extractable here.
chart_type: str = request.config.chart_type
```
--
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]