Skip to content

Commit

Permalink
fix: reindex when combine metric in legacy pivot table
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed May 19, 2021
1 parent 3f6bd1e commit 84d4a88
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 84d4a88

Please sign in to comment.