zeroshade commented on code in PR #2609:
URL: https://github.com/apache/arrow-adbc/pull/2609#discussion_r1995746177
##########
python/adbc_driver_manager/adbc_driver_manager/dbapi.py:
##########
@@ -914,12 +942,17 @@ def adbc_ingest(
self._stmt.bind(data)
elif hasattr(data, "__arrow_c_stream__"):
self._stmt.bind_stream(data)
- elif isinstance(data, pyarrow.RecordBatch):
+ elif _lib.is_pycapsule(data, b"arrow_array"):
+ self._stmt.bind(data)
+ elif _lib.is_pycapsule(data, b"arrow_array_stream"):
+ self._stmt.bind_stream(data)
+ elif _has_pyarrow and isinstance(data, pyarrow.RecordBatch):
array = _lib.ArrowArrayHandle()
schema = _lib.ArrowSchemaHandle()
data._export_to_c(array.address, schema.address)
self._stmt.bind(array, schema)
Review Comment:
should we use `__arrow_c_array__` and just universally use pycapsules?
We could probably skip some of the type/instance checking by just checking
for the pycapsule methods? Or do we still need to keep them to support older
pyarrow versions?
--
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]