Skip to content

Commit

Permalink
Add context to templates / respect slice timeout (#4673)
Browse files Browse the repository at this point in the history
* added context to templates to be able to use filters in SQL

* respect slice timeout in favor of others

* added trailing comma
  • Loading branch information
daoready authored and mistercrunch committed Apr 5, 2018
1 parent df4ff05 commit 92230b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,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
Expand Down
2 changes: 2 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,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 (
Expand Down

0 comments on commit 92230b8

Please sign in to comment.