bito-code-review[bot] commented on PR #43680:
URL: https://github.com/apache/superset/pull/43680#issuecomment-5481525053
<!-- Bito Reply -->
The flagged issue is correct. The current implementation of
`rejected_columns_in_query` in `superset/mcp_service/chart/chart_helpers.py`
indiscriminately collects all columns listed in `rejected_filters`, including
temporal metadata like `__time_range`, which are not actual dataset columns.
When these are compared against the requested filters, they can trigger a
`ValidationError` even if the user did not explicitly request them as filters.
To resolve this, you should filter the rejected columns to ensure only those
that are actually part of the dataset or explicitly requested are considered,
or ensure that temporal metadata is excluded from the rejection check.
Would you like me to implement a fix for this issue? I can also check the
rest of the PR for other comments if you would like to address them as well.
**superset/mcp_service/chart/chart_helpers.py**
```
def rejected_columns_in_query(query: Any) -> set[str]:
# ... existing logic ...
columns = {
column
for entry in query.get("rejected_filters", [])
if isinstance(entry, dict)
and isinstance(column := entry.get("column"), str)
and not column.startswith("__") # Proposed fix: exclude temporal
metadata
}
# ... rest of function ...
```
--
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]