diff --git a/python/cudf/cudf/core/multiindex.py b/python/cudf/cudf/core/multiindex.py index eb953a54f6b..12da69740d8 100644 --- a/python/cudf/cudf/core/multiindex.py +++ b/python/cudf/cudf/core/multiindex.py @@ -1637,7 +1637,7 @@ def memory_usage(self, deep=False): def difference(self, other, sort=None): if hasattr(other, "to_pandas"): other = other.to_pandas() - return self.to_pandas().difference(other, sort) + return cudf.from_pandas(self.to_pandas().difference(other, sort)) @_cudf_nvtx_annotate def append(self, other): diff --git a/python/cudf/cudf/tests/test_multiindex.py b/python/cudf/cudf/tests/test_multiindex.py index bc9cf20b711..eedc9b0c174 100644 --- a/python/cudf/cudf/tests/test_multiindex.py +++ b/python/cudf/cudf/tests/test_multiindex.py @@ -1697,6 +1697,7 @@ def test_difference(): expected = midx2.to_pandas().difference(midx.to_pandas()) actual = midx2.difference(midx) + assert isinstance(actual, cudf.MultiIndex) assert_eq(expected, actual)