diff --git a/python/cudf/cudf/pandas/_wrappers/common.py b/python/cudf/cudf/pandas/_wrappers/common.py index 468c5687c15..66a51a83896 100644 --- a/python/cudf/cudf/pandas/_wrappers/common.py +++ b/python/cudf/cudf/pandas/_wrappers/common.py @@ -46,5 +46,10 @@ def cuda_array_interface(self: _FastSlowProxy): return self._fsproxy_fast.__cuda_array_interface__ +@property # type: ignore +def array_interface(self: _FastSlowProxy): + return self._fsproxy_slow.__array_interface__ + + def custom_iter(self: _FastSlowProxy): return iter(self._fsproxy_slow) diff --git a/python/cudf/cudf/pandas/_wrappers/numpy.py b/python/cudf/cudf/pandas/_wrappers/numpy.py index 94298872213..c445be46f58 100644 --- a/python/cudf/cudf/pandas/_wrappers/numpy.py +++ b/python/cudf/cudf/pandas/_wrappers/numpy.py @@ -15,6 +15,7 @@ make_intermediate_proxy_type, ) from .common import ( + array_interface, array_method, arrow_array_method, cuda_array_interface, @@ -115,6 +116,7 @@ def wrap_ndarray(cls, arr: cupy.ndarray | numpy.ndarray, constructor): # So that pa.array(wrapped-numpy-array) works "__arrow_array__": arrow_array_method, "__cuda_array_interface__": cuda_array_interface, + "__array_interface__": array_interface, # ndarrays are unhashable "__hash__": None, # iter(cupy-array) produces an iterable of zero-dim device