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

[BUG] MultiIndex.difference returns pd.MultiIndex #14008

Closed
galipremsagar opened this issue Aug 30, 2023 · 0 comments · Fixed by #14009
Closed

[BUG] MultiIndex.difference returns pd.MultiIndex #14008

galipremsagar opened this issue Aug 30, 2023 · 0 comments · Fixed by #14009
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

galipremsagar commented Aug 30, 2023

Describe the bug
MultiIndex.difference has a back to pd.MultiIndex.difference, but the result isn't converted back to cudf.MultiIndex

Steps/Code to reproduce bug

In [1]: import cudf

In [3]: idx = cudf.MultiIndex.from_tuples([('a', 'b'), ('a', 'c'), ('b', 'd')])

In [4]: idx
Out[4]: 
MultiIndex([('a', 'b'),
            ('a', 'c'),
            ('b', 'd')],
           )

In [5]: type(idx)
Out[5]: cudf.core.multiindex.MultiIndex

In [6]: idx.difference(idx)
Out[6]: MultiIndex([], )

In [7]: type(idx.difference(idx))
Out[7]: pandas.core.indexes.multi.MultiIndex

Expected behavior

In [7]: type(idx.difference(idx))
Out[7]: cudf.core.multiindex.MultiIndex

Environment overview (please complete the following information)

  • Environment location: [Bare-metal]
  • Method of cuDF install: [from source]
@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. labels Aug 30, 2023
@galipremsagar galipremsagar self-assigned this Aug 30, 2023
rapids-bot bot pushed a commit that referenced this issue Aug 30, 2023
closes #14008 

This PR ensures `MultiIndex.difference` returns `cudf.MultiIndex`.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - Bradley Dice (https://github.com/bdice)

URL: #14009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant