Skip to content

Commit 7bcee51

Browse files
committed
fix commit/rollback markers
fix typos
1 parent b0a17e1 commit 7bcee51

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/aio/test_tx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async def check_transaction(s: ydb.aio.table.Session):
149149
with pytest.raises(RuntimeError):
150150
await tx.execute("INSERT INTO %s (id) VALUES (2)" % table_name)
151151

152-
tx.commit()
152+
await tx.commit()
153153

154154
async with s.transaction() as tx:
155155
rs = await tx.execute("SELECT COUNT(*) as cnt FROM %s" % table_name)

ydb/table.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,8 +2454,7 @@ def async_commit(self, settings=None):
24542454
24552455
:return: A future of commit call
24562456
"""
2457-
self._check_split()
2458-
self._finished = True
2457+
self._set_finish(self._COMMIT)
24592458

24602459
if self._tx_state.tx_id is None and not self._tx_state.dead:
24612460
return _utilities.wrap_result_in_future(self)
@@ -2480,8 +2479,7 @@ def async_rollback(self, settings=None):
24802479
24812480
:return: A future of rollback call
24822481
"""
2483-
self._check_split()
2484-
self._finished = True
2482+
self._set_finish(self._ROLLBACK)
24852483

24862484
if self._tx_state.tx_id is None and not self._tx_state.dead:
24872485
return _utilities.wrap_result_in_future(self)

0 commit comments

Comments
 (0)