From 38f67a44ca9e4dfa9d03776bcafc247e48783ec9 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Wed, 25 Nov 2020 12:55:00 +0200 Subject: [PATCH] fix: mutating input df in viz.py (#11795) --- superset/viz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/superset/viz.py b/superset/viz.py index 0a8a7028ed..ab08fe4e70 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1671,6 +1671,7 @@ class DistributionBarViz(BaseViz): # pandas will throw away nulls when grouping/pivoting, # so we substitute NULL_STRING for any nulls in the necessary columns filled_cols = self.groupby + columns + df = df.copy() df[filled_cols] = df[filled_cols].fillna(value=NULL_STRING) row = df.groupby(self.groupby).sum()[metrics[0]].copy()