jorisvandenbossche commented on PR #702:
URL: https://github.com/apache/arrow-adbc/pull/702#issuecomment-1589255443

   > I would prefer that consumers explicitly hold open the connection, but it 
would certainly be more convenient for the PyCapsule/stream to do this 
implicitly.
   
   I don't think this is actually possible (or desirable): the stream capsule 
itself cannot keep the connection/statement open, because it is the exiting 
from the `with` context that closes this connection/statement. Keeping a 
reference to the connection/statement object does not prevent it from being 
closed in the context exit (unless we would change that, but I don't think we 
want that). 
   
   > Perhaps I missed it, but I think the question is not whether the stream 
should close the connection/statement, but whether the stream should hold a 
strong reference to the Python object that keeps the memory for the 
`AdbcConnection`/`AdbcStatement` from being freed
   
   Based on my current understanding, you don't actually need the Python object 
for that, since the stream's private data holds the actual C 
AdbcConnection/Statement, and it's the driver (which itself is not implemented 
in Python) that already ensures the stream keeps that alive? (not super 
familiar with the driver implementations, though, so not sure about this. See 
also second paragraph in 
https://github.com/apache/arrow-adbc/pull/702#issuecomment-1582850472)


-- 
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]

Reply via email to