|
6 | 6 | from __future__ import annotations |
7 | 7 |
|
8 | 8 | import datetime |
9 | | -from functools import partial |
10 | 9 | import operator |
| 10 | +from functools import partial |
11 | 11 | from typing import ( |
12 | 12 | TYPE_CHECKING, |
13 | 13 | Any, |
|
20 | 20 | Timedelta, |
21 | 21 | Timestamp, |
22 | 22 | lib, |
| 23 | +) |
| 24 | +from pandas._libs import ( |
23 | 25 | ops as libops, |
24 | 26 | ) |
25 | 27 | from pandas._libs.tslibs import ( |
|
28 | 30 | is_supported_dtype, |
29 | 31 | is_unitless, |
30 | 32 | ) |
31 | | - |
| 33 | +from pandas.core import roperator |
| 34 | +from pandas.core.computation import expressions |
| 35 | +from pandas.core.construction import ( |
| 36 | + ensure_wrapped_if_datetimelike, |
| 37 | + sanitize_array, |
| 38 | +) |
32 | 39 | from pandas.core.dtypes.cast import ( |
33 | 40 | construct_1d_object_array_from_listlike, |
34 | 41 | find_common_type, |
|
50 | 57 | isna, |
51 | 58 | notna, |
52 | 59 | ) |
53 | | - |
54 | | -from pandas.core import roperator |
55 | | -from pandas.core.computation import expressions |
56 | | -from pandas.core.construction import ( |
57 | | - ensure_wrapped_if_datetimelike, |
58 | | - sanitize_array, |
59 | | -) |
60 | 60 | from pandas.core.ops import missing |
61 | 61 | from pandas.core.ops.dispatch import should_extension_dispatch |
62 | 62 | from pandas.core.ops.invalid import invalid_comparison |
@@ -137,11 +137,8 @@ def comp_method_OBJECT_ARRAY(op, x, y): |
137 | 137 | # GH#63328: Check if there are pd.NA values in the input and return |
138 | 138 | # BooleanArray to properly propagate NA in comparisons |
139 | 139 | x_has_na = any(val is libmissing.NA for val in x.ravel()) |
140 | | - y_has_na = ( |
141 | | - is_scalar(y) and y is libmissing.NA |
142 | | - ) or ( |
143 | | - isinstance(y, np.ndarray) |
144 | | - and any(val is libmissing.NA for val in y.ravel()) |
| 140 | + y_has_na = (is_scalar(y) and y is libmissing.NA) or ( |
| 141 | + isinstance(y, np.ndarray) and any(val is libmissing.NA for val in y.ravel()) |
145 | 142 | ) |
146 | 143 |
|
147 | 144 | if x_has_na or y_has_na: |
|
0 commit comments