From 7325a4fb4ba08f554454534fe9efe3d0eea5a6ce Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 10 Nov 2016 23:54:51 +0000 Subject: [PATCH] [hotfix] table view not group by without orderby fails --- superset/config.py | 1 + superset/viz.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index b8dbd62f226..dcd40c39b98 100644 --- a/superset/config.py +++ b/superset/config.py @@ -247,6 +247,7 @@ JINJA_CONTEXT_ADDONS = {} try: from superset_config import * # noqa + print('Loaded your LOCAL configuration') except ImportError: pass diff --git a/superset/viz.py b/superset/viz.py index aca2ac740d4..ce4ddecd26a 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -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):