Skip to content

test(sql-parser): pin quoted identifiers with spaces are not subqueries (#32541, #32684)#40143

Merged
rusackas merged 1 commit into
masterfrom
tdd/issue-32541-column-name-spaces-subquery
May 18, 2026
Merged

test(sql-parser): pin quoted identifiers with spaces are not subqueries (#32541, #32684)#40143
rusackas merged 1 commit into
masterfrom
tdd/issue-32541-column-name-spaces-subquery

Conversation

@rusackas
Copy link
Copy Markdown
Member

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:

  • Postgres double-quoted identifiers with spaces, accents, slashes, dots
  • MySQL backtick-quoted identifiers with spaces

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

Closes #32541
Closes #32684

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 15, 2026

Code Review Agent Run #e74f82

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • tests/unit_tests/sql/parse_tests.py - 1
Review Details
  • Files reviewed - 1 · Commit Range: 032fddf..032fddf
    • tests/unit_tests/sql/parse_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.17%. Comparing base (2b71d96) to head (032fddf).

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           
Flag Coverage Δ
hive 39.47% <ø> (ø)
mysql 59.17% <ø> (ø)
postgres 59.25% <ø> (ø)
presto 41.16% <ø> (ø)
python 60.69% <ø> (ø)
sqlite 58.89% <ø> (ø)
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@sadpandajoe sadpandajoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rusackas rusackas merged commit 9bfa064 into master May 18, 2026
66 of 67 checks passed
@rusackas rusackas deleted the tdd/issue-32541-column-name-spaces-subquery branch May 18, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛some field alias create "Error: Custom SQL fields cannot contain sub-queries" on columns with multiple spaces

3 participants