From 76c53cabfbe1cfc1dcb9d32737584d92f42d64f1 Mon Sep 17 00:00:00 2001 From: anjakefala Date: Wed, 7 Aug 2024 23:43:58 +0000 Subject: [PATCH] add test for copy buffer in test_io.py --- python/pyarrow/tests/test_io.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/pyarrow/tests/test_io.py b/python/pyarrow/tests/test_io.py index ef499a3a8d76c..65aa445e1572e 100644 --- a/python/pyarrow/tests/test_io.py +++ b/python/pyarrow/tests/test_io.py @@ -699,6 +699,13 @@ def test_non_cpu_buffer(pickle_module): # Sliced buffers with same address assert buf_on_gpu_sliced.equals(cuda_buf[2:4]) + # Testing copying buffer + mm = ctx.memory_manager + buf2 = cuda_buf.copy(mm) + cuda_buf2 = cuda.CudaBuffer.from_buffer(buf2) + cuda_buf2.size == cuda_buf.size + cuda_buf2.copy_to_host()[:] == b'testing' + # Buffers on different devices msg_device = "Device on which the data resides differs between buffers" with pytest.raises(ValueError, match=msg_device):