Skip to content

Commit

Permalink
fix: Sunburst chart error when secondary metric is null (#25159)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Sep 1, 2023
1 parent 1f5cec9 commit aea9167
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ def get_data(self, df: pd.DataFrame) -> VizData:
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:
Expand Down Expand Up @@ -1582,7 +1582,7 @@ def get_data(self, df: pd.DataFrame) -> VizData:
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"]
Expand Down

0 comments on commit aea9167

Please sign in to comment.