Skip to content

Commit d6850b2

Browse files
committed
review fixes
1 parent 98dc11c commit d6850b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ydb_dbapi/connections.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class IsolationLevel(str, Enum):
3030

3131

3232
class _IsolationSettings(NamedTuple):
33-
ydb_mode: ydb.BaseQueryTxMode | None
33+
ydb_mode: ydb.BaseQueryTxMode
3434
interactive: bool
3535

3636

@@ -187,16 +187,19 @@ def wait_ready(self, timeout: int = 10) -> None:
187187

188188
self._session = self._session_pool.acquire()
189189

190+
@handle_ydb_errors
190191
def commit(self) -> None:
191192
if self._tx_context and self._tx_context.tx_id:
192193
self._tx_context.commit()
193194
self._tx_context = None
194195

196+
@handle_ydb_errors
195197
def rollback(self) -> None:
196198
if self._tx_context and self._tx_context.tx_id:
197199
self._tx_context.rollback()
198200
self._tx_context = None
199201

202+
@handle_ydb_errors
200203
def close(self) -> None:
201204
self.rollback()
202205

@@ -311,16 +314,19 @@ async def wait_ready(self, timeout: int = 10) -> None:
311314

312315
self._session = await self._session_pool.acquire()
313316

317+
@handle_ydb_errors
314318
async def commit(self) -> None:
315319
if self._tx_context and self._tx_context.tx_id:
316320
await self._tx_context.commit()
317321
self._tx_context = None
318322

323+
@handle_ydb_errors
319324
async def rollback(self) -> None:
320325
if self._tx_context and self._tx_context.tx_id:
321326
await self._tx_context.rollback()
322327
self._tx_context = None
323328

329+
@handle_ydb_errors
324330
async def close(self) -> None:
325331
await self.rollback()
326332

0 commit comments

Comments
 (0)