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

Function test_scanner_memory_pool

python/pyarrow/tests/test_dataset.py:618–633  ·  view source on GitHub ↗
(dataset)

Source from the content-addressed store, hash-verified

616
617@pytest.mark.parquet
618def test_scanner_memory_pool(dataset):
619 # honor default pool - https://issues.apache.org/jira/browse/ARROW-18164
620 old_pool = pa.default_memory_pool()
621 # TODO(ARROW-18293) we should be able to use the proxy memory pool for
622 # for testing, but this crashes
623 # pool = pa.proxy_memory_pool(old_pool)
624 pool = pa.system_memory_pool()
625 pa.set_memory_pool(pool)
626
627 try:
628 allocated_before = pool.bytes_allocated()
629 scanner = ds.Scanner.from_dataset(dataset)
630 _ = scanner.to_table()
631 assert pool.bytes_allocated() > allocated_before
632 finally:
633 pa.set_memory_pool(old_pool)
634
635
636@pytest.mark.parquet

Callers

nothing calls this directly

Calls 4

system_memory_poolMethod · 0.80
set_memory_poolMethod · 0.80
bytes_allocatedMethod · 0.45
to_tableMethod · 0.45

Tested by

no test coverage detected