korbit-ai[bot] commented on code in PR #33037:
URL: https://github.com/apache/superset/pull/33037#discussion_r2033215480
##########
superset/migrations/shared/utils.py:
##########
@@ -172,11 +172,7 @@ def paginated_update(
def try_load_json(data: Optional[str]) -> dict[str, Any]:
- try:
- return data and json.loads(data) or {}
- except json.JSONDecodeError:
- print(f"Failed to parse: {data}")
- return {}
+ return data and json.loads(data) or {}
Review Comment:
Thanks for your quick response, @michael-s-molina. I see your point about
letting the error surface to be handled by the callers. In light of this,
perhaps we could consider adding some clarification about this behavior in the
function's docstring or add a comment in the code where try_load_json is used,
indicating that handling json.JSONDecodeError is the caller's responsibility.
It can help future developers working on this code understand the expected
behavior.
--
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]