john-bodley commented on code in PR #26461:
URL: https://github.com/apache/superset/pull/26461#discussion_r1449216186


##########
superset/models/helpers.py:
##########
@@ -1974,7 +1974,9 @@ def get_sqla_query(  # pylint: 
disable=too-many-arguments,too-many-locals,too-ma
                 and db_engine_spec.allows_hidden_cc_in_orderby
                 and col.name in [select_col.name for select_col in 
select_exprs]
             ):
-                col = literal_column(col.name)
+                engine = self.database._get_sqla_engine()
+                quote = engine.dialect.identifier_preparer.quote
+                col = literal_column(quote(col.name))

Review Comment:
   Interesting. Typically the SQLAlchemy dialect should handle the quoting. 
Additionally it's unclear whether forceably quoting the column would be 
problematic when combined with an alias.
   
   @villebro do you have any insights on this? I see previously you registered 
https://github.com/sqlalchemy/sqlalchemy/issues/4730 related to SQLAlchemy not 
quoting.



-- 
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]

Reply via email to