mikebridge opened a new pull request, #44899: URL: https://github.com/apache/superset/pull/44899
### SUMMARY A chart-data request against a semantic view that carried a SQL `extras.where` or `extras.having` crashed with `AttributeError: 'SemanticView' object has no attribute 'database'`. `QueryObject._sanitize_filters` reads `self.datasource.database` to sanitize the clause, which only SQL datasets have, so the request failed with a 500 before reaching the provider. This rejects non-empty SQL WHERE/HAVING extras on a semantic view up front with a `QueryObjectValidationError`, which the chart-data API already maps to a 400 with an actionable message (remove the SQL clause or use a semantic dimension filter). SQL datasets keep their existing sanitizer path unchanged. Also adds a short note to the semantic member selections doc and the new string to `messages.pot`. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A (backend validation). ### TESTING INSTRUCTIONS - `pytest tests/unit_tests/queries/query_object_test.py`: two new cases (WHERE and HAVING) fail on master with the `AttributeError` and pass here; 43 tests pass in the file. - The translation-template drift check passes with the new string. - Not covered: no HTTP-level test was added; the 400 mapping is the existing handling of `QueryObjectValidationError` in the chart-data API. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: `SEMANTIC_LAYERS` - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Introduces new feature or API - [ ] Removes existing feature or API Behaviour change: a semantic-view request with SQL WHERE/HAVING extras now gets a 400 with a message, where it previously got a 500. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
