mistercrunch closed pull request #4673: Add context to templates / respect 
slice timeout
URL: https://github.com/apache/incubator-superset/pull/4673
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/connectors/sqla/models.py 
b/superset/connectors/sqla/models.py
index ef8c68ebb3..8a93373a2e 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -462,6 +462,9 @@ def get_sqla_query(  # sqla
             'metrics': metrics,
             'row_limit': row_limit,
             'to_dttm': to_dttm,
+            'filter': filter,
+            'columns': {col.column_name: col for col in self.columns},
+
         }
         template_processor = self.get_template_processor(**template_kwargs)
         db_engine_spec = self.database.db_engine_spec
diff --git a/superset/viz.py b/superset/viz.py
index 6f17ad71a7..697fb98ca8 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -251,6 +251,8 @@ def query_obj(self):
 
     @property
     def cache_timeout(self):
+        if self.form_data.get('cache_timeout'):
+            return int(self.form_data.get('cache_timeout'))
         if self.datasource.cache_timeout:
             return self.datasource.cache_timeout
         if (


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to