From a3dcb0f309bf8c8036ce844c750053e35244b437 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 8 Apr 2016 22:32:12 -0700 Subject: [PATCH] closes #292 (#304) --- caravel/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caravel/forms.py b/caravel/forms.py index b5ff1db0bf..062427cdb1 100644 --- a/caravel/forms.py +++ b/caravel/forms.py @@ -113,7 +113,9 @@ class FormFactory(object): viz = self.viz datasource = viz.datasource default_metric = datasource.metrics_combo[0][0] - default_groupby = datasource.groupby_column_names[0] + + gb_cols = datasource.groupby_column_names + default_groupby = gb_cols[0] if gb_cols else None group_by_choices = [(s, s) for s in datasource.groupby_column_names] # Pool of all the fields that can be used in Caravel self.field_dict = {