villebro commented on issue #25073:
URL: https://github.com/apache/superset/issues/25073#issuecomment-1701316574
@KSPT-taylorjohn here's an alternative solution that I came up with when
experimenting - I think both should work the same:
```patch
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 2e48fc3c66..e2c0a5981b 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -1463,7 +1463,13 @@ class ExploreMixin: # pylint:
disable=too-many-public-methods
groupby = groupby or []
rejected_adhoc_filters_columns: list[Union[str, ColumnTyping]] = []
applied_adhoc_filters_columns: list[Union[str, ColumnTyping]] = []
- series_column_names = utils.get_column_names(series_columns or [])
+ db_engine_spec = self.db_engine_spec
+ series_column_labels = [
+ db_engine_spec.make_label_compatible(column)
+ for column in utils.get_column_names(
+ columns=series_columns or [],
+ )
+ ]
# deprecated, to be removed in 2.0
if is_timeseries and timeseries_limit:
series_limit = timeseries_limit
@@ -1476,7 +1482,6 @@ class ExploreMixin: # pylint:
disable=too-many-public-methods
template_kwargs["removed_filters"] = removed_filters
template_kwargs["applied_filters"] = applied_template_filters
template_processor = self.get_template_processor(**template_kwargs)
- db_engine_spec = self.db_engine_spec
prequeries: list[str] = []
orderby = orderby or []
need_groupby = bool(metrics is not None or groupby)
@@ -1620,8 +1625,8 @@ class ExploreMixin: # pylint:
disable=too-many-public-methods
)
groupby_all_columns[outer.name] = outer
if (
- is_timeseries and not series_column_names
- ) or outer.name in series_column_names:
+ is_timeseries and not series_column_labels
+ ) or outer.name in series_column_labels:
groupby_series_columns[outer.name] = outer
select_exprs.append(outer)
elif columns:
```
<img width="1253" alt="image"
src="https://github.com/apache/superset/assets/33317356/ef14012c-65d7-4acf-982e-94fd882d1fc0">
--
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]