You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2026/10/05 03:09:31 UTC

Re: [PR] fix(python/adbc_driver_manager): cancel the connection when reading a partition [arrow-adbc]

Copilot commented on code in PR #4814:
URL: https://github.com/apache/arrow-adbc/pull/4814#discussion_r4180462428


##########
python/adbc_driver_manager/adbc_driver_manager/dbapi.py:
##########
@@ -1290,12 +1303,12 @@ def adbc_read_partition(self, partition: bytes) -> None:
         """
         _requires_pyarrow()
         self._clear()
-        self._results = None
+        self._cancel = self._conn._conn.cancel
         handle = _blocking_call(
-            self._conn._conn.read_partition, (partition,), {}, self._stmt.cancel
+            self._conn._conn.read_partition, (partition,), {}, self._cancel
         )
         self._rowcount = -1
-        self._results = _RowIterator(self._stmt, handle, self._backend)
+        self._results = _RowIterator(self._cancel, handle, self._backend)

Review Comment:
   The added Flight SQL test only cancels while `adbc_read_partition()` itself is blocked, so no `_RowIterator` is ever created. It would still pass if this line incorrectly used statement cancellation, leaving the new cancellation behavior during a blocking `fetchone()`/`fetch_arrow_table()` unprotected. Please add a partition response that returns a stream before later reads block, then verify `adbc_cancel()` interrupts that fetch through the connection.



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