You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sfirke (via GitHub)" <gi...@apache.org> on 2025/10/03 18:41:52 UTC
[I] Column names with spaces cannot be used on x-axis, break existing charts (6.0.0rc2) [superset]
sfirke opened a new issue, #35493:
URL: https://github.com/apache/superset/issues/35493
### Bug description
1. Create a dataset where a column has a space in the name
2. Put it on the X-axis of a bar chart.
Chart will fail to render with `Unable to parse SQL`. Error logs:
```
sqlglot.errors.ParseError: Invalid expression / Unexpected token. Line 1, Col: 32.
SELECT TOP 100 Test AS Column AS [Test Column], COUNT(*) AS count
FROM dbo.test_table_with_spaces GROUP BY Test AS Column ORDER BY
```
A column name with a space CAN go in a Dimension, which means this isn't a problem for e..g, pie charts. This seems to be isolated to the x-axis.
### Screenshots/recordings
**Works in 4.1.3**
<img width="1128" height="757" alt="Image" src="https://github.com/user-attachments/assets/62f75b7d-cfc5-435a-94b7-cc5084269496" />
**Broken in 6.0.0rc2**
<img width="1955" height="792" alt="Image" src="https://github.com/user-attachments/assets/81402a85-ee3d-4ff8-a68f-88cb712b8b66" />
_Other_
I created the dataset with
```
SELECT 1 AS [Test Column], 1 AS [Other_Column]
INTO test_table_with_spaces
```
### Superset version
master / latest-dev
### Python version
Not applicable
### Node version
Not applicable
### Browser
Firefox
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Column names with spaces cannot be used on x-axis, break existing charts (6.0.0rc2) [superset]
Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz closed issue #35493: Column names with spaces cannot be used on x-axis, break existing charts (6.0.0rc2)
URL: https://github.com/apache/superset/issues/35493
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Column names with spaces cannot be used on x-axis, break existing charts (6.0.0rc2) [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #35493:
URL: https://github.com/apache/superset/issues/35493#issuecomment-3366841205
<!-- Answer -->
This is a regression in Superset's backend SQL generation logic for bar charts. The double aliasing (`Test AS Column AS [Test Column]`) happens because the code responsible for building SQL expressions for chart axes (especially in `SqlaTable`'s `adhoc_column_to_sqla` and related methods) now applies aliases incorrectly when column names contain spaces. This breaks SQL parsing for the x-axis in bar charts, while other chart types (like pie charts) are unaffected because they generate SQL differently.
Recent changes to support cross-catalog queries for engines like Snowflake and Doris (see [PR #34360](https://github.com/apache/superset/pull/34360)) introduced stricter identifier quoting, which can also cause SQL parse errors if the engine expects separate quoting for catalog, schema, and table parts. Disabling cross-catalog query support for affected engines (e.g., setting `SnowflakeEngineSpec.supports_cross_catalog_queries = False` in `superset_config.py`) is a known workaround for those cases, but it doesn't fix the double aliasing bug for all databases [source](https://github.com/apache/superset/issues/35116).
Other workarounds are: renaming columns to avoid spaces, using snake_case, or leveraging Superset's custom display labels (so you can show spaces in the UI without having them in the actual column name) [source](https://github.com/apache/superset/issues/32879).
A permanent fix will require a patch in Superset's backend to ensure aliases are only applied once and that columns with spaces are quoted correctly when building SQL for chart axes. For now, avoiding spaces in column names or disabling cross-catalog queries (where relevant) are the only reliable mitigations.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ceca3eb3-2940-4d9f-a807-2dd4185271da?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35493)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org