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

Function check_transcoding

python/pyarrow/tests/test_io.py:1837–1849  ·  view source on GitHub ↗
(data, src_encoding, dest_encoding, chunk_sizes)

Source from the content-addressed store, hash-verified

1835
1836
1837def check_transcoding(data, src_encoding, dest_encoding, chunk_sizes):
1838 chunk_sizes = iter(chunk_sizes)
1839 stream = pa.transcoding_input_stream(
1840 pa.BufferReader(data.encode(src_encoding)),
1841 src_encoding, dest_encoding)
1842 out = []
1843 while True:
1844 buf = stream.read(next(chunk_sizes))
1845 out.append(buf)
1846 if not buf:
1847 break
1848 out = b''.join(out)
1849 assert out.decode(dest_encoding) == data
1850
1851
1852@pytest.mark.parametrize('src_encoding, dest_encoding',

Callers 1

Calls 6

BufferReaderMethod · 0.80
encodeMethod · 0.45
readMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected