()
| 426 | |
| 427 | @needs_cffi |
| 428 | def test_export_import_device_batch(): |
| 429 | check_export_import_batch( |
| 430 | "ArrowDeviceArray", |
| 431 | pa.RecordBatch._export_to_c_device, |
| 432 | pa.RecordBatch._import_from_c_device, |
| 433 | make_batch, |
| 434 | ) |
| 435 | |
| 436 | # verify exported struct |
| 437 | c_array = ffi.new("struct ArrowDeviceArray*") |
| 438 | ptr_array = int(ffi.cast("uintptr_t", c_array)) |
| 439 | batch = make_batch() |
| 440 | batch._export_to_c_device(ptr_array) |
| 441 | assert c_array.device_type == 1 # ARROW_DEVICE_CPU 1 |
| 442 | assert c_array.device_id == -1 |
| 443 | assert c_array.array.length == 2 |
| 444 | |
| 445 | |
| 446 | def _export_import_batch_reader(ptr_stream, reader_factory): |
nothing calls this directly
no test coverage detected