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

Function test_leak2

python/scripts/test_leak.py:59–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58
59def test_leak2():
60 data = [pa.array(np.concatenate([np.random.randn(100000)] * 10))]
61 table = pa.Table.from_arrays(data, ['foo'])
62
63 def func():
64 df = table.to_pandas()
65
66 batch = pa.RecordBatch.from_pandas(df)
67
68 sink = io.BytesIO()
69 writer = pa.RecordBatchFileWriter(sink, batch.schema)
70 writer.write_batch(batch)
71 writer.close()
72
73 buf_reader = pa.BufferReader(sink.getvalue())
74 reader = pa.open_file(buf_reader)
75 reader.read_all()
76
77 assert_does_not_leak(func, iterations=50, tolerance=50)
78
79
80def test_leak3():

Callers

nothing calls this directly

Calls 3

assert_does_not_leakFunction · 0.85
arrayMethod · 0.45
concatenateMethod · 0.45

Tested by

no test coverage detected