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

lyndsi pushed a commit to branch 
lyndsi/sql-lab-new-explore-button-functionality-and-move-save-dataset-to-split-save-button
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 2b0d04da5c43b453fe46449e987eb6800bac4913
Author: Hugh A. Miles II <[email protected]>
AuthorDate: Mon Jul 11 12:43:40 2022 +0000

    remove parathesis around columns
---
 superset/models/helpers.py | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index a503706c76..2b7c30e0ef 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -1004,9 +1004,6 @@ class ExploreMixin:  # pylint: 
disable=too-many-public-methods
         or a virtual table with it's own subquery. If the FROM is referencing a
         CTE, the CTE is returned as the second value in the return tuple.
         """
-        # todo(hugh): fix this
-        # if not self.is_virtual:
-        #     return self.get_sqla_table(), None
 
         from_sql = self.get_rendered_sql(template_processor)
         parsed_query = ParsedQuery(from_sql)
@@ -1267,9 +1264,7 @@ class ExploreMixin:  # pylint: 
disable=too-many-public-methods
             "time_column": granularity,
             "time_grain": time_grain,
             "to_dttm": to_dttm.isoformat() if to_dttm else None,
-            "table_columns": [
-                col.get("column_name") for col in self.columns
-            ],  # [col.column_name for col in self.columns],
+            "table_columns": [col.get("column_name") for col in self.columns],
             "filter": filter,
         }
         columns = columns or []
@@ -1407,7 +1402,7 @@ class ExploreMixin:  # pylint: 
disable=too-many-public-methods
                     # if groupby field equals a selected column
                     elif selected in columns_by_name:
                         if isinstance(columns_by_name[selected], dict):
-                            outer = literal_column(f"({selected})")
+                            outer = literal_column(f"{selected}")
                             outer = self.make_sqla_column_compatible(outer, 
selected)
                         else:
                             outer = columns_by_name[selected].get_sqla_col()
@@ -1462,22 +1457,6 @@ class ExploreMixin:  # pylint: 
disable=too-many-public-methods
                 select_exprs.insert(0, timestamp)
                 groupby_all_columns[timestamp.name] = timestamp
 
-            # Use main dttm column to support index with secondary dttm 
columns.
-            if (
-                db_engine_spec.time_secondary_columns
-                and self.main_dttm_col in self.dttm_cols
-                and self.main_dttm_col != dttm_col.column_name
-            ):
-                pass
-                # todo(hughhh): fix time filter
-                # time_filters.append(
-                #     columns_by_name[self.main_dttm_col].get_time_filter(
-                #         from_dttm,
-                #         to_dttm,
-                #     )
-                # )
-            # time_filters.append(dttm_col.get_time_filter(from_dttm, to_dttm))
-
         # Always remove duplicates by column name, as sometimes `metrics_exprs`
         # can have the same name as a groupby column (e.g. when users use
         # raw columns as custom SQL adhoc metric).
@@ -1649,7 +1628,7 @@ class ExploreMixin:  # pylint: 
disable=too-many-public-methods
                         raise QueryObjectValidationError(
                             _("Invalid filter operation type: %(op)s", op=op)
                         )
-        # todo(hugh): fix this
+        # todo(hugh): fix this w/ template_processor
         # where_clause_and += 
self.get_sqla_row_level_filters(template_processor)
         if extras:
             where = extras.get("where")

Reply via email to