Skip to content

Commit

Permalink
fix: reindex when combine metric in legacy pivot table (apache#14708)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie authored and cccs-RyanS committed Dec 17, 2021
1 parent afe4ae1 commit 686265c
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 686265c

Please sign in to comment.