File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 26
26
import operator
27
27
import pickle
28
28
import re
29
+ import sys
29
30
30
31
import numpy as np
31
32
import pytest
@@ -2172,14 +2173,21 @@ def test_str_removeprefix(val):
2172
2173
@pytest .mark .parametrize (
2173
2174
"encoding, exp" ,
2174
2175
[
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
+ ),
2177
2184
],
2185
+ ids = ["utf8" , "utf32" ],
2178
2186
)
2179
2187
def test_str_encode (errors , encoding , exp ):
2180
2188
ser = pd .Series (["abc" , None ], dtype = ArrowDtype (pa .string ()))
2181
2189
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 ()))
2183
2191
tm .assert_series_equal (result , expected )
2184
2192
2185
2193
You can’t perform that action at this time.
0 commit comments