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

Function make_compressed_output

python/pyarrow/tests/test_io.py:1699–1710  ·  view source on GitHub ↗
(data, fn, compression)

Source from the content-addressed store, hash-verified

1697
1698
1699def make_compressed_output(data, fn, compression):
1700 raw = pa.BufferOutputStream()
1701 with pa.CompressedOutputStream(raw, compression) as compressed:
1702 assert not compressed.closed
1703 assert not compressed.readable()
1704 assert compressed.writable()
1705 assert not compressed.seekable()
1706 compressed.write(data)
1707 assert compressed.closed
1708 assert raw.closed
1709 with open(fn, "wb") as f:
1710 f.write(raw.getvalue())
1711
1712
1713@pytest.mark.gzip

Callers 2

Calls 3

BufferOutputStreamMethod · 0.80
writableMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected