test(sql-parser): pin quoted identifiers with spaces are not subqueries (#32541, #32684)#40143
Conversation
Code Review Agent Run #e74f82Actionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40143 +/- ##
=======================================
Coverage 64.17% 64.17%
=======================================
Files 2590 2590
Lines 138087 138087
Branches 32039 32039
=======================================
Hits 88615 88615
Misses 47947 47947
Partials 1525 1525
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SUMMARY
This is a test-only PR opened as a TDD-style validation of issues #32541 and #32684 (the same bug reported twice).
Both issues report an opaque `Custom SQL fields cannot contain sub-queries.` error when a user adds a column whose name contains spaces (or accents, slashes, dots) to a chart — e.g. `"Adresse E-mail"` (Postgres) or ```Answer Created Time``` (MySQL). Snake-case aliases worked; multi-word display names did not.
The check that raises that error is `parsed_statement.has_subquery()` in `superset/models/helpers.py:206`.
This PR adds a parameterized regression test on `SQLStatement.has_subquery()` covering:
How to interpret CI
TESTING INSTRUCTIONS
```bash
pytest tests/unit_tests/sql/parse_tests.py::test_quoted_column_name_with_spaces_is_not_subquery -v
```
ADDITIONAL INFORMATION
🤖 Generated with Claude Code