You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/05/24 17:41:49 UTC

[GitHub] [arrow-adbc] lidavidm commented on a diff in pull request #702: feat(python/adbc_driver_manager): experiment with using PyCapsules

lidavidm commented on code in PR #702:
URL: https://github.com/apache/arrow-adbc/pull/702#discussion_r1204559902


##########
python/adbc_driver_manager/adbc_driver_manager/_lib.pyx:
##########
@@ -498,6 +511,11 @@ cdef class ArrowArrayStreamHandle:
         """The address of the ArrowArrayStream."""
         return <uintptr_t> &self.stream
 
+    def _to_capsule(self):
+        return cpython.PyCapsule_New(
+            &self.stream, 'arrowarraystream', pycapsule_stream_deleter

Review Comment:
   > Also, once we have a standard capsule format, I'm not sure `ArrowArrayStreamHandle` is still useful.
   
   Sure, it was a stopgap.
   
   > I think the capsule needs to own a malloc'ed ArrowArrayStream pointer.
   
   Either that or it should keep the Python object itself alive (which may be desirable since it'll also keep associated ADBC state alive)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org