bito-code-review[bot] commented on code in PR #38277:
URL: https://github.com/apache/superset/pull/38277#discussion_r2927448625
##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -295,7 +296,10 @@ def generate_dashboard(
if serialize_tag_object(tag) is not None
],
roles=[], # Dashboard roles not typically set at creation
- charts=[], # Chart details not needed in response
+ charts=[
+ serialize_chart_object(chart)
+ for chart in getattr(dashboard, "slices", [])
+ ],
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Filter None from charts list</b></div>
<div id="fix">
The charts field should filter out None values from serialize_chart_object
results, matching the pattern used for owners and tags fields to prevent
potential Pydantic validation errors.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
charts=[
serialize_chart_object(chart)
for chart in getattr(dashboard, "slices", [])
if serialize_chart_object(chart) is not None
],
````
</div>
</details>
</div>
<small><i>Code Review Run #3138ae</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]