paleolimbot commented on code in PR #409:
URL: https://github.com/apache/arrow-nanoarrow/pull/409#discussion_r1550782191
##########
python/tests/test_device.py:
##########
@@ -31,12 +30,51 @@ def test_cpu_device():
cpu = device.resolve(1, 0)
assert cpu.device_type == 1
- pa_array = pa.array([1, 2, 3])
- darray = device.c_device_array(pa_array)
+def test_c_device_array():
+ # Unrecognized arguments should be passed to c_array() to generate CPU
array
+ darray = device.c_device_array([1, 2, 3], na.int32())
+
assert darray.device_type == 1
assert darray.device_id == 0
- assert darray.array.length == 3
assert "device_type: 1" in repr(darray)
Review Comment:
This was a bit of a rabbit hole but a very good rabbit hole. There's no
enum, but there is an ABI-stable set of defines that I turned into one and the
result is much better!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]