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
(cherry picked from commit aea9167)
  • Loading branch information
michael-s-molina committed Sep 5, 2023
1 parent f778b62 commit b53042a
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 @@ -1375,7 +1375,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 @@ -1583,7 +1583,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 b53042a

Please sign in to comment.