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

michaelsmolina 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 aea916782d fix: Sunburst chart error when secondary metric is null 
(#25159)
aea916782d is described below

commit aea916782da20c621dd2cb4171afd7cff36472c5
Author: Michael S. Molina <[email protected]>
AuthorDate: Fri Sep 1 14:09:45 2023 -0300

    fix: Sunburst chart error when secondary metric is null (#25159)
---
 superset/viz.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset/viz.py b/superset/viz.py
index 8b88907292..a70d9de22d 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1374,7 +1374,7 @@ class SunburstViz(BaseViz):
         metric = utils.get_metric_name(form_data["metric"])
         secondary_metric = (
             utils.get_metric_name(form_data["secondary_metric"])
-            if "secondary_metric" in form_data
+            if form_data.get("secondary_metric")
             else None
         )
         if metric == secondary_metric or secondary_metric is None:
@@ -1582,7 +1582,7 @@ class WorldMapViz(BaseViz):
         metric = utils.get_metric_name(self.form_data["metric"])
         secondary_metric = (
             utils.get_metric_name(self.form_data["secondary_metric"])
-            if "secondary_metric" in self.form_data
+            if self.form_data.get("secondary_metric")
             else None
         )
         columns = ["country", "m1", "m2"]

Reply via email to