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] IntervalColumn loosing type metadata when Index.union operation is performed #14041

Closed
galipremsagar opened this issue Sep 6, 2023 · 0 comments · Fixed by #14051
Closed
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
When a union operation is performed on IntervalIndex, type metadata are being lost.

Steps/Code to reproduce bug

In [1]: import cudf

In [2]: import pandas as pd

In [3]: idx = pd.IntervalIndex.from_tuples([(0, 2), (0, 2),(2, 4)])

In [4]: gidx = cudf.from_pandas(idx)

In [5]: gidx
Out[5]: IntervalIndex([(0, 2], (0, 2], (2, 4]], dtype='interval[int64, right]')

In [7]: ngidx = cudf.from_pandas(pd.IntervalIndex.from_tuples([ (0, 2),(2, 4)]))

In [8]: gidx.union(ngidx)
Out[8]: IntervalIndex([{'0': 0, '1': 2}, {'0': 0, '1': 2}, {'0': 2, '1': 4}], dtype='struct')

Expected behavior

In [9]: gidx.to_pandas().union(ngidx.to_pandas())
Out[9]: IntervalIndex([(0, 2], (0, 2], (2, 4]], dtype='interval[int64, right]')

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 Sep 6, 2023
@galipremsagar galipremsagar self-assigned this Sep 6, 2023
rapids-bot bot pushed a commit that referenced this issue Sep 7, 2023
Fixes: #14041 

This PR fixes `fillna` that will preserve the type-metadata for `IntervalColumn`.

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

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

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