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 b7917f78f7bc45d69dec6aff0797d8d7d822e65a
Author: Hugh A. Miles II <[email protected]>
AuthorDate: Fri Jun 17 14:14:17 2022 +0000

    fix ds main_dttm
---
 superset/models/helpers.py | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 8b39ab03e2..d52be71646 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -697,16 +697,15 @@ class ExploreMixin:
         return 0
 
     @property
-    def main_dttm_col(self) -> str:  # todo - this should be a real column
-        return "ds"
+    def main_dttm_col(self) -> str:
+        for col in self.columns:
+            if col.get('is_dttm'):
+                return col.get('column_name')
+        return None
 
     @property
     def dttm_cols(self) -> List[str]:
-        return []
-        # l = [c.column_name for c in self.columns if c.is_dttm]
-        # if self.main_dttm_col and self.main_dttm_col not in l:
-        #     l.append(self.main_dttm_col)
-        # return l
+        return [col.get('column_name') for col in self.columns if 
col.get('is_dttm')]
 
     @staticmethod
     def get_extra_cache_keys(query_obj):
@@ -838,13 +837,8 @@ class ExploreMixin:
 
     def exc_query(self, qry: Any) -> QueryResult:
         qry_start_dttm = datetime.now()
-        # todo(hugh): apply filters for extended query
         query_str_ext = self.get_query_str_extended(qry)
         sql = query_str_ext.sql
-
-        print("*****" * 5)
-
-        # sql = "select count(*) from flights"
         status = QueryStatus.SUCCESS
         errors = None
         error_message = None

Reply via email to