From faaf07a7924a289a6fa0f2474976bd4338c84993 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 9 Feb 2024 09:04:16 +0100 Subject: [PATCH] GH-39999: [Python] Fix tests for pandas with CoW / nightly integration tests (#40000) ### Rationale for this change Fixing a failing test with pandas nightly because of CoW changes. * Closes: #39999 Authored-by: Joris Van den Bossche Signed-off-by: Joris Van den Bossche --- python/pyarrow/tests/test_pandas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py index 8106219057efe..676cc96151161 100644 --- a/python/pyarrow/tests/test_pandas.py +++ b/python/pyarrow/tests/test_pandas.py @@ -3650,7 +3650,8 @@ def test_singleton_blocks_zero_copy(): prior_allocation = pa.total_allocated_bytes() result = t.to_pandas() - assert result['f0'].values.flags.writeable + # access private `_values` because the public `values` is made read-only by pandas + assert result['f0']._values.flags.writeable assert pa.total_allocated_bytes() > prior_allocation