bito-code-review[bot] commented on code in PR #44028:
URL: https://github.com/apache/superset/pull/44028#discussion_r4051743452
##########
superset/dashboards/api.py:
##########
@@ -2750,6 +2752,8 @@ def copy_dash(self, original_dash: Dashboard) -> Response:
dash = CopyDashboardCommand(original_dash, data).run()
except DashboardForbiddenError:
return self.response_403()
+ except DashboardInvalidError as ex:
+ return self.response_422(message=ex.normalized_messages())
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Empty 422 error body</b></div>
<div id="fix">
`DashboardInvalidError()` raised in `CopyDashboardCommand.validate()`
(copy.py:62) carries no exceptions, so `normalized_messages()` returns `{}` and
this 422 body is empty. Reachable when `dashboard_title` is empty/None (schema
allows it via `allow_none=True`). Attach a `ValidationError` or fall back to
the exception message so clients get a real error.
</div>
</div>
<small><i>Code Review Run #bc0dd5</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]