This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new bfc9cdb2cc GH-50037: [Python] test_table_uses_memory_pool flaky on
macOS 14 job (#50045)
bfc9cdb2cc is described below
commit bfc9cdb2cc8e1dcbfef5e97db2e3e9f5a15fd356
Author: tadeja <[email protected]>
AuthorDate: Mon Jun 8 18:28:47 2026 +0200
GH-50037: [Python] test_table_uses_memory_pool flaky on macOS 14 job
(#50045)
### Rationale for this change
Fixes #50037
### What changes are included in this PR?
Add `gc.collect()` before `prior_allocation = pa.total_allocated_bytes()`
in `test_table_uses_memory_pool`
and also add to `_check_to_pandas_memory_unchanged` helper with the same
pattern.
Same fix as #44793
### Are these changes tested?
Not reproduced locally yet.
### Are there any user-facing changes?
No.
* GitHub Issue: #50037
Authored-by: Tadeja Kadunc <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
python/pyarrow/tests/test_pandas.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/python/pyarrow/tests/test_pandas.py
b/python/pyarrow/tests/test_pandas.py
index 4c8e6f8259..326473b109 100644
--- a/python/pyarrow/tests/test_pandas.py
+++ b/python/pyarrow/tests/test_pandas.py
@@ -3901,6 +3901,7 @@ def test_singleton_blocks_zero_copy():
def _check_to_pandas_memory_unchanged(obj, **kwargs):
+ gc.collect()
prior_allocation = pa.total_allocated_bytes()
x = obj.to_pandas(**kwargs) # noqa
@@ -3966,6 +3967,7 @@ def test_table_uses_memory_pool():
arr = pa.array(np.arange(N, dtype=np.int64))
t = pa.table([arr, arr, arr], ['f0', 'f1', 'f2'])
+ gc.collect()
prior_allocation = pa.total_allocated_bytes()
x = t.to_pandas()