Skip to content

Commit a6e8087

Browse files
CLN: remove special case for StringDtype in assert repr
1 parent cc40732 commit a6e8087

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pandas/_testing/asserters.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -584,19 +584,13 @@ def raise_assert_detail(
584584

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

594590
if isinstance(right, np.ndarray):
595591
right = pprint_thing(right)
596-
elif isinstance(right, (CategoricalDtype, NumpyEADtype)):
592+
elif isinstance(right, (CategoricalDtype, StringDtype, NumpyEADtype)):
597593
right = repr(right)
598-
elif isinstance(right, StringDtype):
599-
right = f"StringDtype(storage={right.storage}, na_value={right.na_value})"
600594

601595
msg += f"""
602596
[left]: {left}

0 commit comments

Comments
 (0)