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/07/30 16:52:06 UTC

[GitHub] [superset] serenajiang commented on a change in pull request #15975: fix: eliminate cartesian product columns in pivot operator

serenajiang commented on a change in pull request #15975:
URL: https://github.com/apache/superset/pull/15975#discussion_r680088605



##########
File path: superset/utils/pandas_postprocessing.py
##########
@@ -264,6 +264,17 @@ def pivot(  # pylint: disable=too-many-arguments
     #  Remove once/if support is added.
     aggfunc = {na.column: na.aggfunc for na in aggregate_funcs.values()}
 
+    # When dropna = False, the pivot_table function will calculate cartesian-product
+    # for MultiIndex.
+    # https://github.com/apache/superset/issues/15956
+    # https://github.com/pandas-dev/pandas/issues/18030
+    series_set = set()
+    lst_to_str: Callable[[List[Any]], str] = lambda lst: "_".join(str(_) for _ in lst)

Review comment:
       minor nit - I think you could just replace calls of this this with `str()`.




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