Skip to content

Commit 229de79

Browse files
committed
MNT: fix copy/paste error for NA type extracted from Pandas
1 parent ab7649f commit 229de79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

numpy/_core/tests/_natype.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def method(self, other):
1616
other is pd_NA
1717
or isinstance(other, (str, bytes))
1818
or isinstance(other, (numbers.Number, np.bool))
19-
or util.is_array(other)
19+
or isinstance(other, np.ndarray)
2020
and not other.shape
2121
):
2222
# Need the other.shape clause to handle NumPy scalars,
@@ -27,7 +27,7 @@ def method(self, other):
2727
else:
2828
return pd_NA
2929

30-
elif util.is_array(other):
30+
elif isinstance(other, np.ndarray):
3131
out = np.empty(other.shape, dtype=object)
3232
out[:] = pd_NA
3333

@@ -36,14 +36,14 @@ def method(self, other):
3636
else:
3737
return out
3838

39-
elif is_cmp and isinstance(other, (date, time, timedelta)):
39+
elif is_cmp and isinstance(other, (np.datetime64, np.timedelta64)):
4040
return pd_NA
4141

42-
elif isinstance(other, date):
42+
elif isinstance(other, np.datetime64):
4343
if name in ["__sub__", "__rsub__"]:
4444
return pd_NA
4545

46-
elif isinstance(other, timedelta):
46+
elif isinstance(other, np.timedelta64):
4747
if name in ["__sub__", "__rsub__", "__add__", "__radd__"]:
4848
return pd_NA
4949

0 commit comments

Comments
 (0)