john-bodley commented on a change in pull request #9031: [fix] Pivot table
metric ordering
URL:
https://github.com/apache/incubator-superset/pull/9031#discussion_r371614993
##########
File path: superset/viz.py
##########
@@ -694,15 +694,14 @@ def get_data(self, df: pd.DataFrame) -> VizData:
columns = self.form_data.get("columns")
if self.form_data.get("transpose_pivot"):
groupby, columns = columns, groupby
+ metrics = [utils.get_metric_name(m) for m in self.form_data["metrics"]]
df = df.pivot_table(
index=groupby,
columns=columns,
- values=[
- utils.get_metric_name(m) for m in
self.form_data.get("metrics", [])
Review comment:
There's no need to do `self.form_data.get("metrics", [])` since in the
`query_obj` method we've already verified there exists at least one metric.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]