codeant-ai-for-open-source[bot] commented on code in PR #37300:
URL: https://github.com/apache/superset/pull/37300#discussion_r2711160194
##########
superset/extensions/types.py:
##########
@@ -34,3 +34,6 @@ class LoadedExtension:
frontend: dict[str, bytes]
backend: dict[str, bytes]
version: str
+ source_base_path: (
+ str # Base path for traceback filenames (absolute path or supx:// URL)
+ )
Review Comment:
**Suggestion:** Breaking change: adding `source_base_path` as a required
dataclass field (no default) will cause existing code that constructs
`LoadedExtension` without this new argument to raise a TypeError at runtime.
Make the field optional or provide a default to preserve backward
compatibility. [possible bug]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Extension loading fails with TypeError during instantiation.
- ❌ Background tasks using extensions fail at startup/runtime.
- ⚠️ Backwards compatibility for third‑party extensions broken.
```
</details>
```suggestion
source_base_path: str = "" # Base path for traceback filenames
(absolute path or supx:// URL)
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open a Python REPL or run any process that imports the dataclass: `from
superset.extensions.types import LoadedExtension` (file:
`superset/extensions/types.py:30-39`).
2. Instantiate the dataclass with the pre-PR argument set used across the
codebase, e.g.:
`LoadedExtension(id="ext1", name="ext", manifest=..., frontend={},
backend={},
version="1.0")`
(this mirrors how LoadedExtension objects were constructed before adding
the new
field).
3. Observe Python raising a TypeError similar to:
"TypeError: __init__() missing 1 required positional argument:
'source_base_path'"
This is raised from the dataclass-generated __init__ defined by
`LoadedExtension` (see
`superset/extensions/types.py:30-39`).
4. Runtime effect: any code path that previously constructed LoadedExtension
without the
new argument (e.g. extension registration/loader) will fail at instantiation
time. Because
the PR description and stacktrace examples reference extension execution,
this will
manifest when extensions are loaded or registered during startup or when
tasks execute
(see `superset/tasks/executor.py:108` in PR description).
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/extensions/types.py
**Line:** 37:39
**Comment:**
*Possible Bug: Breaking change: adding `source_base_path` as a required
dataclass field (no default) will cause existing code that constructs
`LoadedExtension` without this new argument to raise a TypeError at runtime.
Make the field optional or provide a default to preserve backward compatibility.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
--
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]