Skip to content

Commit

Permalink
Fix IntervalIndex.repr
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Aug 25, 2023
1 parent aef903c commit ae2d585
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -3211,6 +3211,9 @@ def _is_interval(self):
def _is_boolean(self):
return False

def _clean_nulls_from_index(self):
return self


class StringIndex(GenericIndex):
"""String defined indices into another Column
Expand Down
13 changes: 13 additions & 0 deletions python/cudf/cudf/tests/test_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,3 +1469,16 @@ def test_repr_struct_after_concat():
pdf = df.to_pandas()

assert repr(df) == repr(pdf)


def test_interval_index_repr():
pi = pd.Index(
[
np.nan,
pd.Interval(2.0, 3.0, closed="right"),
pd.Interval(3.0, 4.0, closed="right"),
]
)
gi = cudf.from_pandas(pi)

assert repr(pi) == repr(gi)

0 comments on commit ae2d585

Please sign in to comment.