[hotfix] table view not group by without orderby fails

This commit is contained in:
Maxime Beauchemin
2016-11-10 23:54:51 +00:00
parent 90f00c5b29
commit 7325a4fb4b
2 changed files with 3 additions and 1 deletions

View File

@@ -247,6 +247,7 @@ JINJA_CONTEXT_ADDONS = {}
try:
from superset_config import * # noqa
print('Loaded your LOCAL configuration')
except ImportError:
pass

View File

@@ -441,7 +441,8 @@ class TableViz(BaseViz):
if fd.get('all_columns'):
d['columns'] = fd.get('all_columns')
d['groupby'] = []
d['orderby'] = [json.loads(t) for t in fd.get('order_by_cols', [])]
order_by_cols = fd.get('order_by_cols', []) or []
d['orderby'] = [json.loads(t) for t in order_by_cols]
return d
def get_df(self, query_obj=None):