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

Function test_call_function_with_memory_pool

python/pyarrow/tests/test_compute.py:283–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281
282@pytest.mark.numpy
283def test_call_function_with_memory_pool():
284 arr = pa.array(["foo", "bar", "baz"])
285 indices = np.array([2, 2, 1])
286 result1 = arr.take(indices)
287 result2 = pc.call_function('take', [arr, indices],
288 memory_pool=pa.default_memory_pool())
289 expected = pa.array(["baz", "baz", "bar"])
290 assert result1.equals(expected)
291 assert result2.equals(expected)
292
293 result3 = pc.take(arr, indices, memory_pool=pa.default_memory_pool())
294 assert result3.equals(expected)
295
296
297def test_pickle_functions(pickle_module):

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
arrayMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected