Skip to content

Commit 116d0f9

Browse files
committed
Revert unintended changes to interval.py
1 parent fa77cec commit 116d0f9

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

pandas/core/arrays/interval.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,20 +1423,9 @@ def mid(self) -> Index:
14231423
)
14241424
def overlaps(self, other):
14251425
if isinstance(other, (IntervalArray, ABCIntervalIndex)):
1426-
if not isinstance(other, IntervalArray):
1427-
other = IntervalArray(other)
1428-
if len(self) != len(other):
1429-
raise ValueError("Both IntervalArrays must have the same length.")
1430-
if self.closed != other.closed:
1431-
raise ValueError(
1432-
"Both IntervalArrays must have the same 'closed' property."
1433-
)
1434-
1435-
op1 = le if (self.closed_left and other.closed_right) else lt
1436-
op2 = le if (other.closed_left and self.closed_right) else lt
1437-
return op1(self.left, other.right) & op2(other.left, self.right)
1426+
raise NotImplementedError
14381427
if not isinstance(other, Interval):
1439-
msg = f" `other` must be Interval-like, got {type(other).__name__}"
1428+
msg = f"`other` must be Interval-like, got {type(other).__name__}"
14401429
raise TypeError(msg)
14411430

14421431
# equality is okay if both endpoints are closed (overlap at a point)

0 commit comments

Comments
 (0)