bito-code-review[bot] commented on PR #44899:
URL: https://github.com/apache/superset/pull/44899#issuecomment-5961629239
<!-- Bito Reply -->
The flagged issue is correct. The current implementation in
`superset/common/query_object.py` performs a hard validation that rejects
`where` and `having` clauses for semantic views before the semantic mapper can
process them. To resolve this, you should remove the explicit validation block
in `_sanitize_filters` and allow the semantic mapper to handle these extras, as
it is designed to convert them into provider filters.
Would you like me to implement this fix and check the rest of the PR
comments for you?
**superset/common/query_object.py**
```
def _sanitize_filters(self) -> None:
- if (
- self.datasource
- and self.datasource.type == "semantic_view"
- and (self.extras.get("where") or self.extras.get("having"))
- ):
- raise QueryObjectValidationError(
- _(
- "SQL WHERE/HAVING expressions are not supported for
semantic "
- "views. Remove the SQL clause or use a semantic
dimension filter."
- )
- )
-
from superset.jinja_context import get_template_processor
```
--
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]