davlee1972 opened a new issue, #41966:
URL: https://github.com/apache/arrow/issues/41966

   ### Describe the enhancement requested
   
   
   Can we add a metadata object to pyarrow.RecordBatchReader than can be 
updated?
   
   For my use case the RecordBatchReader is pulling data from a database cursor 
and I need to keep the cursor object around until the RecordBatchReader is 
used. Ideally the cursor would be stored as as metadata reference so it doesn't 
go out of scope.
   
   This is to support my ADBC use case:
   https://github.com/apache/arrow-adbc/issues/1893
   
   Here's the hacked code I put together to add a extras metadata object to 
RecordBatchReader.
   
   ```
   from forbiddenfruit import curse as _curse
   from pyarrow import RecordBatchReader
   
   def _set_extra(self, key, value):
       """sets extra attribute
       :param key:
       :param value:
       """
       self.extras[key] = value
   
   _curse(RecordBatchReader, "extras", {})
   _curse(RecordBatchReader, "set_extra", _set_extra)
   ```
   
   
   ### Component(s)
   
   C++, Python


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