Skip to content

Commit 74ebfab

Browse files
committed
FIX-#2596: added comment about pandas regression
Signed-off-by: Dmitry Chigarev <[email protected]>
1 parent 89b2e53 commit 74ebfab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modin/data_management/functions/groupby_function.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ def reduce(
7777
drop=False,
7878
**kwargs,
7979
):
80-
by_part = list(df.index.names)
81-
if drop and len(df.columns.intersection(pandas.Index(by_part))) > 0:
80+
# Wrapping names into an Index should be unnecessary, however
81+
# there is a bug in pandas with intersection that forces us to do so:
82+
# https://github.com/pandas-dev/pandas/issues/39699
83+
by_part = pandas.Index(df.index.names)
84+
if drop and len(df.columns.intersection(by_part)) > 0:
8285
df.drop(columns=by_part, errors="ignore", inplace=True)
8386

8487
groupby_args = groupby_args.copy()

0 commit comments

Comments
 (0)