File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 2626import operator
2727import pickle
2828import re
29+ import sys
2930
3031import numpy as np
3132import pytest
@@ -2172,14 +2173,21 @@ def test_str_removeprefix(val):
21722173@pytest .mark .parametrize (
21732174 "encoding, exp" ,
21742175 [
2175- ["utf8" , b"abc" ],
2176- ["utf32" , b"\xff \xfe \x00 \x00 a\x00 \x00 \x00 b\x00 \x00 \x00 c\x00 \x00 \x00 " ],
2176+ ("utf8" , {"little" : b"abc" , "big" : "abc" }),
2177+ (
2178+ "utf32" ,
2179+ {
2180+ "little" : b"\xff \xfe \x00 \x00 a\x00 \x00 \x00 b\x00 \x00 \x00 c\x00 \x00 \x00 " ,
2181+ "big" : b"\x00 \x00 \xfe \xff \x00 \x00 \x00 a\x00 \x00 \x00 b\x00 \x00 \x00 c" ,
2182+ },
2183+ ),
21772184 ],
2185+ ids = ["utf8" , "utf32" ],
21782186)
21792187def test_str_encode (errors , encoding , exp ):
21802188 ser = pd .Series (["abc" , None ], dtype = ArrowDtype (pa .string ()))
21812189 result = ser .str .encode (encoding , errors )
2182- expected = pd .Series ([exp , None ], dtype = ArrowDtype (pa .binary ()))
2190+ expected = pd .Series ([exp [ sys . byteorder ] , None ], dtype = ArrowDtype (pa .binary ()))
21832191 tm .assert_series_equal (result , expected )
21842192
21852193
You can’t perform that action at this time.
0 commit comments