Add context to templates / respect slice timeout (#4673)
* added context to templates to be able to use filters in SQL * respect slice timeout in favor of others * added trailing comma
This commit is contained in:
parent
df4ff05441
commit
92230b8535
|
|
@ -477,6 +477,9 @@ class SqlaTable(Model, BaseDatasource):
|
|||
'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
|
||||
|
|
|
|||
|
|
@ -279,6 +279,8 @@ class BaseViz(object):
|
|||
|
||||
@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 (
|
||||
|
|
|
|||
Loading…
Reference in New Issue