kylebarron commented on issue #2680: URL: https://github.com/apache/iceberg-python/issues/2680#issuecomment-3598488728
The point of the PyCapsule Interface is to not have your API be stuck/tied to any one library implementation. So instead of taking in a `table: pyarrow.Table`, you should take in an `ArrowStreamExportable`, [defined as](https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#protocol-typehints) ```py class ArrowStreamExportable(Protocol): def __arrow_c_stream__( self, requested_schema: object | None = None ) -> object: ... ``` So for any input object that advertises an `__arrow_c_stream__` method, you can import its data into your internal Arrow implementation of choice using, say, `pyarrow.table(input_object)` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
