Skip to content

Commit a6fffbe

Browse files
committed
Check if tests besides dtypes fail by going to pyarrow
1 parent 62ef870 commit a6fffbe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/_testing/asserters.py

+8
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,14 @@ def assert_attr_equal(attr: str, left, right, obj: str = "Attributes") -> None:
474474
left_attr = getattr(left, attr)
475475
right_attr = getattr(right, attr)
476476

477+
if attr == "dtype":
478+
from pandas.core.arrays.arrow.dtype import ArrowDtype
479+
480+
if isinstance(left_attr, ArrowDtype):
481+
left_attr = left_attr.pyarrow_dtype.to_pandas_dtype()
482+
if isinstance(right_attr, ArrowDtype):
483+
right_attr = right_attr.pyarrow_dtype.to_pandas_dtype()
484+
477485
if left_attr is right_attr or is_matching_na(left_attr, right_attr):
478486
# e.g. both np.nan, both NaT, both pd.NA, ...
479487
return None

0 commit comments

Comments
 (0)