fix: Edge case with metric not getting quoted in sort by when normalize_columns is enabled (#33337)

This commit is contained in:
Vitor Avila
2025-05-02 22:20:57 -03:00
committed by GitHub
parent 5a9e366c0a
commit 9f0ae77341

View File

@@ -1585,10 +1585,6 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
# use the existing instance.
col = metrics_exprs_by_expr.get(str(col), col)
need_groupby = True
elif col in columns_by_name:
col = self.convert_tbl_column_to_sqla_col(
columns_by_name[col], template_processor=template_processor
)
elif col in metrics_exprs_by_label:
col = metrics_exprs_by_label[col]
need_groupby = True
@@ -1597,6 +1593,10 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
template_processor=template_processor
)
need_groupby = True
elif col in columns_by_name:
col = self.convert_tbl_column_to_sqla_col(
columns_by_name[col], template_processor=template_processor
)
if isinstance(col, ColumnElement):
orderby_exprs.append(col)