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

Function make_compressed_output

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

Source from the content-addressed store, hash-verified

1705
1706
1707def make_compressed_output(data, fn, compression):
1708 raw = pa.BufferOutputStream()
1709 with pa.CompressedOutputStream(raw, compression) as compressed:
1710 assert not compressed.closed
1711 assert not compressed.readable()
1712 assert compressed.writable()
1713 assert not compressed.seekable()
1714 compressed.write(data)
1715 assert compressed.closed
1716 assert raw.closed
1717 with open(fn, "wb") as f:
1718 f.write(raw.getvalue())
1719
1720
1721@pytest.mark.gzip

Callers 2

Calls 3

BufferOutputStreamMethod · 0.80
writableMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected