bito-code-review[bot] commented on code in PR #38723:
URL: https://github.com/apache/superset/pull/38723#discussion_r2954374715
##########
superset/commands/report/execute.py:
##########
@@ -268,7 +268,11 @@ def get_dashboard_urls(
native_filter_params =
self._report_schedule.get_native_filters_params()
if anchor := dashboard_state.get("anchor"):
try:
- anchor_list: list[str] = json.loads(anchor)
+ anchor_list = json.loads(anchor)
+ if not isinstance(anchor_list, list):
+ raise json.JSONDecodeError(
+ "Anchor value is not a list", anchor, 0
+ )
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incomplete input validation</b></div>
<div id="fix">
The validation checks if anchor_list is a list but doesn't verify that all
elements are strings, as expected by _get_tabs_urls(tab_anchors: list[str]). If
the JSON contains a list of non-strings (e.g., integers), it will proceed and
likely cause a runtime error later when creating permalinks. Consider adding a
check for element types to match the intended list[str] type.
</div>
</div>
<small><i>Code Review Run #ee0d0e</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]