bito-code-review[bot] commented on code in PR #40536:
URL: https://github.com/apache/superset/pull/40536#discussion_r3328037609
##########
superset/commands/chart/create.py:
##########
@@ -43,6 +44,11 @@ class CreateChartCommand(CreateMixin, BaseCommand):
def __init__(self, data: dict[str, Any]):
self._properties = data.copy()
+ if params_str := self._properties.get("params"):
+ params = json.loads(params_str)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Uncaught JSON parse exception</b></div>
<div id="fix">
Wrap `json.loads(params_str)` in a try-except block to catch
`JSONDecodeError` and convert it into a `ChartInvalidError`, ensuring malformed
JSON is handled gracefully.
</div>
</div>
<small><i>Code Review Run #21ab12</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]