jorisvandenbossche commented on code in PR #39980:
URL: https://github.com/apache/arrow/pull/39980#discussion_r1498931146
##########
python/pyarrow/array.pxi:
##########
@@ -1778,6 +1778,70 @@ cdef class Array(_PandasConvertible):
return pyarrow_wrap_array(array)
+ def _export_to_c_device(self, out_ptr, out_schema_ptr=0):
+ """
+ Export to a C ArrowDeviceArray struct, given its pointer.
+
+ If a C ArrowSchema struct pointer is also given, the array type
+ is exported to it at the same time.
+
+ Parameters
+ ----------
+ out_ptr: int
+ The raw pointer to a C ArrowDeviceArray struct.
+ out_schema_ptr: int (optional)
+ The raw pointer to a C ArrowSchema struct.
+
+ Be careful: if you don't pass the ArrowDeviceArray struct to a
consumer,
+ array memory will leak. This is a low-level function intended for
+ expert users.
Review Comment:
I copied this from the existing docstrings. We could mention the release
callback explicitly, but essentially then you are a "consumer". This functions
returns an integer, you can't call the release callback on the return value as
such. Only when you actually interpret it as an ArrowArray struct, you can do
that (and at that point, you are a consumer who should be aware of those
details?)
I could also point to the general page about the C Data Interface.
--
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]