()
| 57 | |
| 58 | |
| 59 | def 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 | |
| 80 | def test_leak3(): |
nothing calls this directly
no test coverage detected