NeilPerry1 commented on issue #34784:
URL: https://github.com/apache/superset/issues/34784#issuecomment-4628914534
The main problem is here
In superset/models/helpers.py → get_sqla_query():
1671
```
select_exprs.append(
self.convert_tbl_column_to_sqla_col(
quoted_columns_by_name[selected],
template_processor=template_processor,
label=_column_label,
)
if selected in quoted_columns_by_name
else self.make_sqla_column_compatible(
literal_column(selected), _column_label
)
```
- quoted_columns_by_name = {quote(k): v for k, v in columns_by_name.items()}
wraps keys in dialect-specific quotes (backticks ` for ClickHouse).
- selected arrives from UI/form_data as a raw string ("foo").
- Strict comparison if selected in quoted_columns_by_name: fails.
- Code falls back to literal_column(selected), bypassing
TableColumn.expression.
This is a regression. The if need_groupby: branch correctly resolves columns
via columns_by_name (canonical names), but the elif columns: branch was changed
to use dialect-quoted keys, breaking metadata lookup for non-classic DB
dialects.
--
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]