(unary_func_fixture)
| 629 | |
| 630 | |
| 631 | def test_input_lifetime(unary_func_fixture): |
| 632 | function, func_name = unary_func_fixture |
| 633 | |
| 634 | proxy_pool = pa.proxy_memory_pool(pa.default_memory_pool()) |
| 635 | assert proxy_pool.bytes_allocated() == 0 |
| 636 | |
| 637 | v = pa.array([1] * 1000, type=pa.int64(), memory_pool=proxy_pool) |
| 638 | assert proxy_pool.bytes_allocated() == 1000 * 8 |
| 639 | pc.call_function(func_name, [v]) |
| 640 | assert proxy_pool.bytes_allocated() == 1000 * 8 |
| 641 | # Calling a UDF should not have kept `v` alive longer than required |
| 642 | v = None |
| 643 | assert proxy_pool.bytes_allocated() == 0 |
| 644 | |
| 645 | |
| 646 | def _record_batch_from_iters(schema, *iters): |
nothing calls this directly
no test coverage detected