bito-code-review[bot] commented on code in PR #37899:
URL: https://github.com/apache/superset/pull/37899#discussion_r2794547213
##########
superset/models/slice.py:
##########
@@ -141,16 +141,9 @@ class Slice( # pylint: disable=too-many-public-methods
def __repr__(self) -> str:
return self.slice_name or str(self.id)
- @property
- def cls_model(self) -> type[SqlaTable]:
- # pylint: disable=import-outside-toplevel
- from superset.daos.datasource import DatasourceDAO
-
- return DatasourceDAO.sources[self.datasource_type]
-
@property
def datasource(self) -> SqlaTable | None:
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Broken non-table datasource support</b></div>
<div id="fix">
The datasource property now returns self.table, which only works for 'table'
datasource_type due to the SQLAlchemy relationship condition. For 'query' and
'savedquery' types, it returns None, breaking datasource access in methods like
datasource_link, datasource_url, and viz. This affects charts using non-table
datasources.
</div>
</div>
<small><i>Code Review Run #41b821</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]