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

Function test_compressed_roundtrip

python/pyarrow/tests/test_io.py:1789–1803  ·  view source on GitHub ↗
(compression)

Source from the content-addressed store, hash-verified

1787 )
1788])
1789def test_compressed_roundtrip(compression):
1790 if not Codec.is_available(compression):
1791 pytest.skip(f"{compression} support is not built")
1792
1793 data = b"some test data\n" * 10 + b"eof\n"
1794 raw = pa.BufferOutputStream()
1795 with pa.CompressedOutputStream(raw, compression) as compressed:
1796 compressed.write(data)
1797
1798 cdata = raw.getvalue()
1799 assert len(cdata) < len(data)
1800 raw = pa.BufferReader(cdata)
1801 with pa.CompressedInputStream(raw, compression) as compressed:
1802 got = compressed.read()
1803 assert got == data
1804
1805
1806@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
BufferOutputStreamMethod · 0.80
BufferReaderMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected