bito-code-review[bot] commented on PR #44950:
URL: https://github.com/apache/superset/pull/44950#issuecomment-5985403253
<!-- Bito Reply -->
The flagged issue is valid. The current implementation of `datasource_id`
filtering in `superset/daos/chart.py` and
`superset/mcp_service/chart/schemas.py` relies solely on the `datasource_id`
column, which can lead to collisions if different datasource types (e.g.,
datasets vs. semantic views) share the same ID.
To resolve this, you should update the filter logic to include
`datasource_type` as a required companion field when filtering by
`datasource_id`. This ensures that the query correctly distinguishes between
different types of datasources.
Would you like me to fetch all comments and implement a fix for this and the
rest of the PR comments?
**superset/mcp_service/chart/schemas.py**
```
@model_validator(mode="after")
def validate_datasource_id_filter(self) -> Self:
"""Restrict dataset ID filters to integer equality and membership."""
if self.col != "datasource_id":
return self
# ... existing validation ...
# ADDITION: Ensure datasource_type is also provided or handled
return self
```
--
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]