diff --git a/python/cudf/cudf/core/column/categorical.py b/python/cudf/cudf/core/column/categorical.py index eaffc18db70..5be609c81bc 100644 --- a/python/cudf/cudf/core/column/categorical.py +++ b/python/cudf/cudf/core/column/categorical.py @@ -1272,18 +1272,7 @@ def fillna( self.codes.dtype ) - result = super().fillna(value=fill_value, method=method) - - result = column.build_categorical_column( - categories=self.dtype.categories._values, - codes=column.build_column(result.base_data, dtype=result.dtype), - offset=result.offset, - size=result.size, - mask=result.base_mask, - ordered=self.dtype.ordered, - ) - - return result + return super().fillna(value=fill_value, method=method) def indices_of( self, value: ScalarLike diff --git a/python/cudf/cudf/core/column/column.py b/python/cudf/cudf/core/column/column.py index 9dde17a1045..a8735a1dd8d 100644 --- a/python/cudf/cudf/core/column/column.py +++ b/python/cudf/cudf/core/column/column.py @@ -715,7 +715,7 @@ def fillna( """ return libcudf.replace.replace_nulls( input_col=self, replacement=value, method=method, dtype=dtype - ) + )._with_type_metadata(self.dtype) def isnull(self) -> ColumnBase: """Identify missing values in a Column.""" diff --git a/python/cudf/cudf/core/column/decimal.py b/python/cudf/cudf/core/column/decimal.py index a8a707ec805..5a823c5f7c3 100644 --- a/python/cudf/cudf/core/column/decimal.py +++ b/python/cudf/cudf/core/column/decimal.py @@ -147,10 +147,7 @@ def fillna( "integer values" ) - result = libcudf.replace.replace_nulls( - input_col=self, replacement=value, method=method, dtype=dtype - ) - return result._with_type_metadata(self.dtype) + return super().fillna(value=value, method=method) def normalize_binop_value(self, other): if isinstance(other, ColumnBase): diff --git a/python/cudf/cudf/tests/test_index.py b/python/cudf/cudf/tests/test_index.py index 359b3c519de..5730ecc4ae7 100644 --- a/python/cudf/cudf/tests/test_index.py +++ b/python/cudf/cudf/tests/test_index.py @@ -2050,6 +2050,10 @@ def test_range_index_concat(objs): (pd.Index([0, 1, 2, 30], name="a"), [90, 100]), (pd.Index([0, 1, 2, 30]), pd.Index([0, 10, 1.0, 11])), (pd.Index(["a", "b", "c", "d", "c"]), pd.Index(["a", "c", "z"])), + ( + pd.IntervalIndex.from_tuples([(0, 2), (0, 2), (2, 4)]), + pd.IntervalIndex.from_tuples([(0, 2), (2, 4)]), + ), ], ) @pytest.mark.parametrize("sort", [None, False])