Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions pandas/_testing/asserters.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,13 @@ def raise_assert_detail(

if isinstance(left, np.ndarray):
left = pprint_thing(left)
elif isinstance(left, (CategoricalDtype, NumpyEADtype)):
elif isinstance(left, (CategoricalDtype, StringDtype, NumpyEADtype)):
left = repr(left)
elif isinstance(left, StringDtype):
# TODO(infer_string) this special case could be avoided if we have
# a more informative repr https://github.com/pandas-dev/pandas/issues/59342
left = f"StringDtype(storage={left.storage}, na_value={left.na_value})"

if isinstance(right, np.ndarray):
right = pprint_thing(right)
elif isinstance(right, (CategoricalDtype, NumpyEADtype)):
elif isinstance(right, (CategoricalDtype, StringDtype, NumpyEADtype)):
right = repr(right)
elif isinstance(right, StringDtype):
right = f"StringDtype(storage={right.storage}, na_value={right.na_value})"

msg += f"""
[left]: {left}
Expand Down
Loading