Skip to content

Commit c32ebc4

Browse files
authored
Merge branch 'main' into 5155_Bug_MultiIndex.lookup
2 parents a05d13e + 153073d commit c32ebc4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

arkouda/pandas/extension/_arkouda_array.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77

88
from numpy import ndarray
9+
from numpy.typing import NDArray
910
from pandas.api.extensions import ExtensionArray
1011

1112
from arkouda.numpy.dtypes import dtype as ak_dtype
@@ -188,15 +189,17 @@ def astype(self, dtype, copy: bool = False):
188189
# Fallback: local cast
189190
return self.to_ndarray().astype(npdt, copy=copy)
190191

191-
def isna(self) -> ExtensionArray | ndarray[Any, Any]:
192+
def isna(self) -> NDArray[np.bool_]:
192193
from arkouda.numpy import isnan
193194
from arkouda.numpy.pdarraycreation import full as ak_full
194195
from arkouda.numpy.util import is_float
195196

196197
if not is_float(self._data):
197-
return ak_full(self._data.size, False, dtype=bool)
198+
return (
199+
ak_full(self._data.size, False, dtype=bool).to_ndarray().astype(dtype=bool, copy=False)
200+
)
198201

199-
return isnan(self._data)
202+
return isnan(self._data).to_ndarray().astype(dtype=bool, copy=False)
200203

201204
@property
202205
def dtype(self):

tests/pandas/extension/arkouda_array_extension.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ def test_isna(self):
168168
ak_data = ak.arange(10)
169169
arr = ArkoudaArray(ak_data)
170170
na = arr.isna()
171-
assert ak.all(na == False)
171+
assert np.all(na == False)
172172

173173
def test_isna_with_nan(self):
174174
from arkouda.testing import assert_equal
175175

176176
ak_data = ak.array([1, np.nan, 2])
177177
arr = ArkoudaArray(ak_data)
178178
na = arr.isna()
179-
expected = ak.array([False, True, False])
179+
expected = np.array([False, True, False])
180180
assert_equal(na, expected)
181181

182182
def test_copy(self):

0 commit comments

Comments
 (0)