You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/10/03 22:46:30 UTC

[superset] branch robust_has_table_query updated (75c9f52bb3 -> b51aec2b5a)

This is an automated email from the ASF dual-hosted git repository.

beto pushed a change to branch robust_has_table_query
in repository https://gitbox.apache.org/repos/asf/superset.git


    omit 75c9f52bb3 Fix query error
     new b51aec2b5a Fix query error

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (75c9f52bb3)
            \
             N -- N -- N   refs/heads/robust_has_table_query (b51aec2b5a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 superset/models/helpers.py | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)


[superset] 01/01: Fix query error

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch robust_has_table_query
in repository https://gitbox.apache.org/repos/asf/superset.git

commit b51aec2b5a63be6bc426f404975de1da26923092
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Tue Oct 3 14:34:20 2023 -0700

    Fix query error
---
 superset/models/helpers.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 81650c2dd6..762c05ef03 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -1608,6 +1608,9 @@ class ExploreMixin:  # pylint: disable=too-many-public-methods
         columns = [col for col in columns if col != utils.DTTM_ALIAS]
         dttm_col = columns_by_name.get(granularity) if granularity else None
 
+        dialect = self.db_engine_spec.get_engine().dialect
+        quoter = dialect.identifier_preparer.quote
+
         if need_groupby:
             # dedup columns while preserving order
             columns = groupby or columns
@@ -1629,7 +1632,7 @@ class ExploreMixin:  # pylint: disable=too-many-public-methods
                         )
                     else:
                         selected = validate_adhoc_subquery(
-                            selected,
+                            quoter(selected),
                             self.database_id,
                             self.schema,
                             self.db_engine_spec.engine,
@@ -1652,7 +1655,7 @@ class ExploreMixin:  # pylint: disable=too-many-public-methods
                     _sql = selected["sqlExpression"]
                     _column_label = selected["label"]
                 elif isinstance(selected, str):
-                    _sql = selected
+                    _sql = quoter(selected)
                     _column_label = selected
 
                 selected = validate_adhoc_subquery(