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] Index.difference not returning correct name for the resulting Index #13985

Closed
galipremsagar opened this issue Aug 28, 2023 · 0 comments · Fixed by #13986
Closed

[BUG] Index.difference not returning correct name for the resulting Index #13985

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

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When Index.difference is called using two Index objects with different names, the result shouldn't have a name set.

Steps/Code to reproduce bug

In [1]: import cudf

In [2]: i = cudf.Index(['a', 'b', 'c'], name='a')

In [3]: i2 = cudf.Index(['a'], names='z')

In [4]: i.difference(i2)
Out[4]: StringIndex(['b' 'c'], dtype='object', name='a')

In [5]: i.to_pandas().difference(i2.to_pandas())
Out[5]: Index(['b', 'c'], dtype='object')

Expected behavior

In [4]: i.difference(i2)
Out[4]: StringIndex(['b' 'c'], dtype='object')

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 28, 2023
@galipremsagar galipremsagar self-assigned this Aug 28, 2023
rapids-bot bot pushed a commit that referenced this issue Aug 30, 2023
…13986)

closes #13985
This PR fixes issues with `Index.difference` and `Index.intersection` API where the name selection was incorrect and `NA` values handling wasn't happening in these two APIs.

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

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

URL: #13986
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