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

Function test_input_lifetime

python/pyarrow/tests/test_udf.py:631–643  ·  view source on GitHub ↗
(unary_func_fixture)

Source from the content-addressed store, hash-verified

629
630
631def 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
646def _record_batch_from_iters(schema, *iters):

Callers

nothing calls this directly

Calls 2

bytes_allocatedMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected