Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX-#7060: Fix pivot unexpected exception when index or columns are of Index type #7061

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,9 +1462,9 @@ def pivot(
# index or columns
if values is None:
values = list(self.columns)
if index:
if index is not None:
values = [v for v in values if v not in index]
if columns:
if columns is not None:
values = [v for v in values if v not in columns]

return self.__constructor__(
Expand Down
1 change: 1 addition & 0 deletions modin/pandas/test/dataframe/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def test_pivot(data, index, columns, values, request):
if (
"one_column_values-one_column-default-float_nan_data"
in request.node.callspec.id
or "default-one_column-several_columns_index" in request.node.callspec.id
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One mistake hid another. The bug investigation will be in #7010.

or (
current_execution in ("BaseOnPython", "HdkOnNative")
and index is lib.no_default
Expand Down
Loading