You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2022/09/20 20:50:23 UTC

[superset] 13/29: fix(native filters): groupby filter issue (#21084)

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

elizabeth pushed a commit to branch 2.0-test
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 05d7c3d74d649c27334a23312c67dcd58a33664b
Author: stevetracvc <70...@users.noreply.github.com>
AuthorDate: Mon Aug 22 08:15:33 2022 -0600

    fix(native filters): groupby filter issue (#21084)
    
    (cherry picked from commit d79b0bfc744885f6e6f0b5e9a4128c63c1dea58d)
---
 .../src/filters/components/GroupBy/GroupByFilterPlugin.tsx              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx b/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx
index 9742e27e59..091232a5ec 100644
--- a/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx
+++ b/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx
@@ -71,7 +71,7 @@ export default function PluginFilterGroupBy(props: PluginFilterGroupByProps) {
   }, [JSON.stringify(defaultValue), multiSelect]);
 
   const groupbys = ensureIsArray(formData.groupby).map(getColumnLabel);
-  const groupby = groupbys[0].length ? groupbys[0] : null;
+  const groupby = groupbys[0]?.length ? groupbys[0] : null;
 
   const withData = groupby
     ? data.filter(row => groupby.includes(row.column_name as string))