MCPcopy Create free account
hub / github.com/apache/arrow / test_sequence_utf8_to_unicode

Function test_sequence_utf8_to_unicode

python/pyarrow/tests/test_convert_builtin.py:903–913  ·  view source on GitHub ↗
(ty)

Source from the content-addressed store, hash-verified

901
902@pytest.mark.parametrize("ty", [pa.string(), pa.large_string(), pa.string_view()])
903def test_sequence_utf8_to_unicode(ty):
904 # ARROW-1225
905 data = [b'foo', None, b'bar']
906 arr = pa.array(data, type=ty)
907 assert arr.type == ty
908 assert arr[0].as_py() == 'foo'
909
910 # test a non-utf8 unicode string
911 val = ('mañana').encode('utf-16-le')
912 with pytest.raises(pa.ArrowInvalid):
913 pa.array([val], type=ty)
914
915
916def test_sequence_fixed_size_bytes():

Callers

nothing calls this directly

Calls 3

as_pyMethod · 0.80
arrayMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected