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

Function test_bytes_reader_retains_parent_reference

python/pyarrow/tests/test_io.py:307–320  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305
306
307def test_bytes_reader_retains_parent_reference():
308 import gc
309
310 # ARROW-421
311 def get_buffer():
312 data = b'some sample data' * 1000
313 reader = pa.BufferReader(data)
314 reader.seek(5)
315 return reader.read_buffer(6)
316
317 buf = get_buffer()
318 gc.collect()
319 assert buf.to_pybytes() == b'sample'
320 assert buf.parent is not None
321
322
323def test_python_file_implicit_mode(tmpdir):

Callers

nothing calls this directly

Calls 1

get_bufferFunction · 0.85

Tested by

no test coverage detected