File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33from collections import abc
4- from datetime import (
5- datetime ,
6- )
4+ from datetime import datetime
75import functools
86from itertools import zip_longest
97import operator
@@ -6305,14 +6303,26 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
63056303 return dtype .kind == "b"
63066304 elif is_numeric_dtype (self .dtype ):
63076305 return is_numeric_dtype (dtype )
6308- # GH#62158
63096306 elif isinstance (dtype , ArrowDtype ):
6307+ # GH#62158
63106308 import pyarrow as pa
63116309
63126310 pa_dtype = dtype .pyarrow_dtype
63136311 if dtype .kind != "M" :
63146312 if self .dtype .kind == "m" and pa .types .is_duration (pa_dtype ):
63156313 return True
6314+ if is_string_dtype (self .dtype ) and (
6315+ pa .types .is_string (pa_dtype ) or pa .types .is_large_string (pa_dtype )
6316+ ):
6317+ return True
6318+ if self .dtype .kind == "b" and pa .types .is_boolean (pa_dtype ):
6319+ return True
6320+ if is_numeric_dtype (self .dtype ) and (
6321+ pa .types .is_integer (pa_dtype ) or pa .types .is_floating (pa_dtype )
6322+ ):
6323+ return True
6324+ if is_object_dtype (self .dtype ):
6325+ return True
63166326 return False
63176327 if self .dtype .kind != "M" :
63186328 return False
You can’t perform that action at this time.
0 commit comments