Skip to content

Commit 3421596

Browse files
authored
check if datetime is compared with arrowExtensionArray and convert right side to datetime
1 parent 63249f2 commit 3421596

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,8 @@ def _is_unique(self) -> bool:
965965
# Arithmetic Methods
966966

967967
def _cmp_method(self, other, op):
968+
if isinstance(other, ArrowExtensionArray):
969+
other = other.to_pydatetime()
968970
if self.ndim > 1 and getattr(other, "shape", None) == self.shape:
969971
# TODO: handle 2D-like listlikes
970972
return op(self.ravel(), other.ravel()).reshape(self.shape)

0 commit comments

Comments
 (0)