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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]