You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2021/02/17 21:46:07 UTC

[superset] branch master updated: fix: accept null groupby in form data for timeseries table viz (#13086)

This is an automated email from the ASF dual-hosted git repository.

michellet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 91db008  fix: accept null groupby in form data for timeseries table viz (#13086)
91db008 is described below

commit 91db008d72f1313f2b7593c5c6f2a3fddaf18a3e
Author: michellethomas <mi...@gmail.com>
AuthorDate: Wed Feb 17 13:45:39 2021 -0800

    fix: accept null groupby in form data for timeseries table viz (#13086)
    
    * Allowing timeseries table groupby to be null in form data
    
    * Check truthiness for is_group_by
    
    Co-authored-by: michelle_thomas <mi...@airbnb.com>
---
 superset-frontend/src/visualizations/TimeTable/transformProps.js | 2 +-
 superset/viz.py                                                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/src/visualizations/TimeTable/transformProps.js b/superset-frontend/src/visualizations/TimeTable/transformProps.js
index a49c421..93e0e7d 100644
--- a/superset-frontend/src/visualizations/TimeTable/transformProps.js
+++ b/superset-frontend/src/visualizations/TimeTable/transformProps.js
@@ -20,7 +20,7 @@ export default function transformProps(chartProps) {
   const { height, datasource, formData, queriesData } = chartProps;
   const { columnCollection = [], groupby, metrics, url } = formData;
   const { records, columns } = queriesData[0].data;
-  const isGroupBy = groupby.length > 0;
+  const isGroupBy = groupby?.length > 0;
 
   // When there is a "group by",
   // each row in the table is a database column
diff --git a/superset/viz.py b/superset/viz.py
index db88383..9235f6c 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -803,7 +803,7 @@ class TimeTableViz(BaseViz):
         return dict(
             records=pt.to_dict(orient="index"),
             columns=list(pt.columns),
-            is_group_by=len(fd.get("groupby", [])) > 0,
+            is_group_by=True if fd.get("groupby") else False,
         )