You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/24 17:11:51 UTC

[GitHub] [superset] eschutho commented on a change in pull request #16822: fix(BigQuery): explicitly quote columns in select_star

eschutho commented on a change in pull request #16822:
URL: https://github.com/apache/superset/pull/16822#discussion_r715778282



##########
File path: superset/db_engine_specs/base.py
##########
@@ -952,9 +952,11 @@ def select_star(  # pylint: disable=too-many-arguments,too-many-locals
         if (show_cols or latest_partition) and not cols:
             cols = database.get_columns(table_name, schema)
 
-        if show_cols:
-            fields = cls._get_fields(cols)
         quote = engine.dialect.identifier_preparer.quote
+        if show_cols:
+            # Explicitly quote all column names, as BigQuery doesn't quote column
+            # names that are also identifiers (eg, "limit") by default.
+            fields = [text(quote(col["name"])) for col in cols]

Review comment:
       is this going to affect all dbs? Do you think we should create a property on the db engine spec like "force_column_quotes"?




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