fix: reindex when combine metric in legacy pivot table (#14708)

This commit is contained in:
Yongjie Zhao 2021-05-20 19:14:30 +01:00 committed by GitHub
parent dbebaf219b
commit 9729ffd7a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -936,7 +936,7 @@ class PivotTableViz(BaseViz):
# 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(