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

Function test_scalar_udf_context

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

Source from the content-addressed store, hash-verified

602
603
604def test_scalar_udf_context(unary_func_fixture):
605 # Check the memory_pool argument is properly propagated
606 proxy_pool = pa.proxy_memory_pool(pa.default_memory_pool())
607 _, func_name = unary_func_fixture
608
609 res = pc.call_function(func_name,
610 [pa.array([1] * 1000, type=pa.int64())],
611 memory_pool=proxy_pool)
612 assert res == pa.array([2] * 1000, type=pa.int64())
613 assert proxy_pool.bytes_allocated() == 1000 * 8
614 # Destroying Python array should destroy underlying C++ memory
615 res = None
616 assert proxy_pool.bytes_allocated() == 0
617
618
619def test_raising_func(raising_func_fixture):

Callers

nothing calls this directly

Calls 2

arrayMethod · 0.45
bytes_allocatedMethod · 0.45

Tested by

no test coverage detected