Skip to content

Commit

Permalink
fix: reindex when combine metric in legacy pivot table (#14708)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie authored May 20, 2021
1 parent dbebaf2 commit 9729ffd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ def get_data(self, df: pd.DataFrame) -> VizData:

# Display metrics side by side with each column
if self.form_data.get("combine_metric"):
df = df.stack(0).unstack()
df = df.stack(0).unstack().reindex(level=-1, columns=metrics)
return dict(
columns=list(df.columns),
html=df.to_html(
Expand Down

0 comments on commit 9729ffd

Please sign in to comment.