Skip to content

Commit f767a1f

Browse files
committed
fix: update test for arrow_c_stream_capsule_released to verify destructor behavior and pointer accessibility
1 parent 979af2d commit f767a1f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/tests/test_dataframe.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,9 +1725,11 @@ def test_arrow_c_stream_capsule_released(ctx):
17251725
reader = pa.RecordBatchReader._import_from_c_capsule(capsule)
17261726
reader.read_all()
17271727

1728-
# After import the capsule no longer exposes the pointer
1729-
with pytest.raises(ValueError):
1730-
get_ptr(capsule, b"arrow_array_stream")
1728+
# After import, PyArrow takes ownership and resets the destructor
1729+
assert get_destructor(capsule) == 0
1730+
1731+
# Pointer remains retrievable
1732+
assert get_ptr(capsule, b"arrow_array_stream")
17311733
pyerr_clear()
17321734

17331735

0 commit comments

Comments
 (0)