lidavidm commented on code in PR #2990:
URL: https://github.com/apache/arrow-adbc/pull/2990#discussion_r2154645954
##########
python/adbc_driver_manager/adbc_driver_manager/dbapi.py:
##########
@@ -312,23 +312,24 @@ def __init__(
self._conn = conn
self._conn_kwargs = conn_kwargs
- try:
- self._conn.set_autocommit(False)
- except _lib.NotSupportedError:
- self._commit_supported = False
- if not autocommit:
- warnings.warn(
- "Cannot disable autocommit; conn will not be DB-API 2.0
compliant",
- category=Warning,
- )
+ if autocommit:
self._autocommit = True
+ self._commit_supported = False
else:
- self._autocommit = False
- self._commit_supported = True
-
- if autocommit and self._commit_supported:
- self._conn.set_autocommit(True)
- self._autocommit = True
+ try:
+ self._conn.set_autocommit(False)
+ except _lib.NotSupportedError:
+ self._commit_supported = False
+ if not autocommit:
Review Comment:
Good catch! Fixed
--
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]