bito-code-review[bot] commented on code in PR #42404:
URL: https://github.com/apache/superset/pull/42404#discussion_r3833329069
##########
superset/models/core.py:
##########
@@ -144,6 +144,12 @@ class Theme(AuditMixinNullable, ImportExportMixin, Model):
is_system_default = Column(Boolean, default=False, nullable=False)
is_system_dark = Column(Boolean, default=False, nullable=False)
+ editors = relationship(
+ "Subject",
+ secondary="theme_editors",
+ passive_deletes=True,
+ )
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>CWE-20: Missing class import</b></div>
<div id="fix">
The `Subject` class is referenced in the relationship but not imported.
Dashboard model (line 55-59) correctly imports `Subject` from
`superset.subjects.models` alongside `dashboard_editors`. Without this import,
the model will fail at runtime with NameError when SQLAlchemy resolves the
relationship string. Add the import at the top of the file or within a
TYPE_CHECKING block if you prefer forward references. (See also:
[CWE-20](https://cwe.mitre.org/data/definitions/20.html))
</div>
</div>
<small><i>Code Review Run #fc4e13</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]