@@ -16,7 +16,7 @@ def method(self, other):
16
16
other is pd_NA
17
17
or isinstance (other , (str , bytes ))
18
18
or isinstance (other , (numbers .Number , np .bool ))
19
- or util . is_array (other )
19
+ or isinstance (other , np . ndarray )
20
20
and not other .shape
21
21
):
22
22
# Need the other.shape clause to handle NumPy scalars,
@@ -27,7 +27,7 @@ def method(self, other):
27
27
else :
28
28
return pd_NA
29
29
30
- elif util . is_array (other ):
30
+ elif isinstance (other , np . ndarray ):
31
31
out = np .empty (other .shape , dtype = object )
32
32
out [:] = pd_NA
33
33
@@ -36,14 +36,14 @@ def method(self, other):
36
36
else :
37
37
return out
38
38
39
- elif is_cmp and isinstance (other , (date , time , timedelta )):
39
+ elif is_cmp and isinstance (other , (np . datetime64 , np . timedelta64 )):
40
40
return pd_NA
41
41
42
- elif isinstance (other , date ):
42
+ elif isinstance (other , np . datetime64 ):
43
43
if name in ["__sub__" , "__rsub__" ]:
44
44
return pd_NA
45
45
46
- elif isinstance (other , timedelta ):
46
+ elif isinstance (other , np . timedelta64 ):
47
47
if name in ["__sub__" , "__rsub__" , "__add__" , "__radd__" ]:
48
48
return pd_NA
49
49
0 commit comments