diff --git a/python/cudf/cudf/pandas/_wrappers/pandas.py b/python/cudf/cudf/pandas/_wrappers/pandas.py index 3c82d571939..a4a0c24deda 100644 --- a/python/cudf/cudf/pandas/_wrappers/pandas.py +++ b/python/cudf/cudf/pandas/_wrappers/pandas.py @@ -310,6 +310,18 @@ def Index__new__(cls, *args, **kwargs): additional_attributes={"__init__": _DELETE}, ) +NumpyExtensionArray = make_final_proxy_type( + "NumpyExtensionArray", + _Unusable, + pd.arrays.NumpyExtensionArray, + fast_to_slow=_Unusable(), + slow_to_fast=_Unusable(), + additional_attributes={ + "_ndarray": _FastSlowAttribute("_ndarray"), + "_dtype": _FastSlowAttribute("_dtype"), + }, +) + TimedeltaArray = make_final_proxy_type( "TimedeltaArray", _Unusable, diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index 90356a01404..dff735cfd05 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -1205,6 +1205,14 @@ def test_pickle_groupby(dataframe): tm.assert_equal(pgb.sum(), gb.sum()) +def test_numpy_extension_array(): + np_array = np.array([0, 1, 2, 3]) + xarray = xpd.arrays.NumpyExtensionArray(np_array) + array = pd.arrays.NumpyExtensionArray(np_array) + + tm.assert_equal(xarray, array) + + def test_isinstance_base_offset(): offset = xpd.tseries.frequencies.to_offset("1s") assert isinstance(offset, xpd.tseries.offsets.BaseOffset)