(ty)
| 901 | |
| 902 | @pytest.mark.parametrize("ty", [pa.string(), pa.large_string(), pa.string_view()]) |
| 903 | def 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 | |
| 916 | def test_sequence_fixed_size_bytes(): |