File tree 1 file changed +4
-11
lines changed
pandas/tests/arrays/string_
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -42,23 +42,16 @@ def cls(request):
42
42
return request .param
43
43
44
44
45
- def test_repr (dtype , request ):
46
- if dtype == "arrow_string" :
47
- reason = (
48
- "AssertionError: assert ' A\n 0 a\n 1 None\n 2 b' "
49
- "== ' A\n 0 a\n 1 <NA>\n 2 b'"
50
- )
51
- mark = pytest .mark .xfail (reason = reason )
52
- request .node .add_marker (mark )
53
-
45
+ def test_repr (dtype ):
54
46
df = pd .DataFrame ({"A" : pd .array (["a" , pd .NA , "b" ], dtype = dtype )})
55
47
expected = " A\n 0 a\n 1 <NA>\n 2 b"
56
48
assert repr (df ) == expected
57
49
58
- expected = "0 a\n 1 <NA>\n 2 b\n Name: A, dtype: string "
50
+ expected = f "0 a\n 1 <NA>\n 2 b\n Name: A, dtype: { dtype } "
59
51
assert repr (df .A ) == expected
60
52
61
- expected = "<StringArray>\n ['a', <NA>, 'b']\n Length: 3, dtype: string"
53
+ arr_name = "ArrowStringArray" if dtype == "arrow_string" else "StringArray"
54
+ expected = f"<{ arr_name } >\n ['a', <NA>, 'b']\n Length: 3, dtype: { dtype } "
62
55
assert repr (df .A .array ) == expected
63
56
64
57
You can’t perform that action at this time.
0 commit comments