bito-code-review[bot] commented on code in PR #38217:
URL: https://github.com/apache/superset/pull/38217#discussion_r2847093717
##########
superset/extensions/utils.py:
##########
@@ -228,17 +228,20 @@ def get_extensions() -> dict[str, LoadedExtension]:
# Load extensions from LOCAL_EXTENSIONS configuration (filesystem paths)
for path in current_app.config["LOCAL_EXTENSIONS"]:
- files = get_bundle_files_from_path(path)
- # Use absolute filesystem path to dist directory for tracebacks
- abs_dist_path = str((Path(path) / "dist").resolve())
- extension = get_loaded_extension(files, source_base_path=abs_dist_path)
- extension_id = extension.manifest.id
- extensions[extension_id] = extension
- logger.info(
- "Loading extension %s (ID: %s) from local filesystem",
- extension.name,
- extension_id,
- )
+ try:
+ files = get_bundle_files_from_path(path)
+ # Use absolute filesystem path to dist directory for tracebacks
+ abs_dist_path = str((Path(path) / "dist").resolve())
+ extension = get_loaded_extension(files,
source_base_path=abs_dist_path)
+ extension_id = extension.manifest.id
+ extensions[extension_id] = extension
+ logger.info(
+ "Loading extension %s (ID: %s) from local filesystem",
+ extension.name,
+ extension_id,
+ )
+ except Exception as e: # pylint: disable=broad-except
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Blind exception catch in loop</b></div>
<div id="fix">
Avoid catching blind `Exception` at line 243. Consider catching specific
exceptions like `FileNotFoundError`, `ValidationError`, or `ValueError` instead
to improve error handling clarity.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
except (FileNotFoundError, ValidationError, OSError, Exception) as
e: # pylint: disable=broad-except
````
</div>
</details>
</div>
<small><i>Code Review Run #aa8ce6</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]