You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/02 15:13:57 UTC

[GitHub] [superset] villebro commented on a change in pull request #16026: fix: missing mulitiple metrics on pivot operator

villebro commented on a change in pull request #16026:
URL: https://github.com/apache/superset/pull/16026#discussion_r681055755



##########
File path: superset/utils/pandas_postprocessing.py
##########
@@ -271,8 +271,12 @@ def pivot(  # pylint: disable=too-many-arguments
     series_set = set()
     if not drop_missing_columns and columns:
         for row in df[columns].itertuples():
-            metrics_and_series = tuple(aggfunc.keys()) + tuple(row[1:])
-            series_set.add(str(metrics_and_series))
+            metrics_and_series = []
+            for metric in aggfunc.keys():
+                metrics_and_series.append(tuple([metric]) + tuple(row[1:]))
+            for m_series in metrics_and_series:

Review comment:
       Can we just do it in one pass, like 
   ```python
               for metric in aggfunc.keys():
                   series_set.add(str(tuple([metric]) + tuple(row[1:])))
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org