Skip to content

Commit 3b7552b

Browse files
committed
mypy fixes
1 parent 2dda75a commit 3b7552b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/core/arrays/interval.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ def isin(self, values: ArrayLike) -> npt.NDArray[np.bool_]:
20812081
# complex128 ndarray is much more performant.
20822082
left = self._combined
20832083
right = values._combined
2084-
return np.isin(left, right).ravel() # type: ignore[arg-type]
2084+
return np.isin(left, right).ravel()
20852085

20862086
elif needs_i8_conversion(self.left.dtype) ^ needs_i8_conversion(
20872087
values.left.dtype
@@ -2133,9 +2133,10 @@ def _from_combined(self, combined: np.ndarray) -> IntervalArray:
21332133
return self._shallow_copy(left=new_left, right=new_right)
21342134

21352135
def unique(self) -> IntervalArray:
2136-
nc = unique(
2137-
self._combined # type: ignore[call-overload]
2138-
)
2136+
nc = unique(self._combined)
2137+
# Ensure nc is a numpy array for _from_combined
2138+
if not isinstance(nc, np.ndarray):
2139+
nc = np.asarray(nc)
21392140
nc = nc[:, None]
21402141
return self._from_combined(nc)
21412142

0 commit comments

Comments
 (0)