Copilot commented on code in PR #40559:
URL: https://github.com/apache/superset/pull/40559#discussion_r3337849671
##########
superset/mcp_service/screenshot/webdriver_config.py:
##########
@@ -80,10 +83,13 @@ def pool_stats() -> Any:
stats = pool.get_stats()
return jsonify({"webdriver_pool": stats, "status": "healthy"})
- except Exception as e:
+ except Exception:
from flask import jsonify
Review Comment:
`jsonify` is imported both in the `try` and again in the `except` block.
This is redundant and can also fail to return the intended JSON error response
if the exception was triggered during the first `flask` import (since the
`except` immediately retries the same import). Import `jsonify` once before the
`try` and reuse it in both paths.
--
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]