Skip to content

Commit 341ec3c

Browse files
committed
fix commit/rollback markers
fix typos
1 parent 4de1f30 commit 341ec3c

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

tests/aio/test_tx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ async def test_tx_snapshot_ro(driver, database):
8585

8686
await ro_tx.commit()
8787

88-
ro_tx = session.transaction(tx_mode=ydb.SnapshotReadOnly())
8988
with pytest.raises(ydb.issues.GenericError) as exc_info:
9089
await ro_tx.execute("UPDATE `test` SET value = value + 1")
9190
assert "read only transaction" in exc_info.value.message

tests/table/test_tx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def test_tx_snapshot_ro(driver_sync, database):
8080

8181
ro_tx.commit()
8282

83-
ro_tx = session.transaction(tx_mode=ydb.SnapshotReadOnly())
8483
with pytest.raises(ydb.issues.GenericError) as exc_info:
8584
ro_tx.execute("UPDATE `test` SET value = value + 1")
8685
assert "read only transaction" in exc_info.value.message

ydb/table.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,8 +2459,7 @@ def async_commit(self, settings=None):
24592459
24602460
:return: A future of commit call
24612461
"""
2462-
self._check_split()
2463-
self._finished = True
2462+
self._set_finish(self._COMMIT)
24642463

24652464
if self._tx_state.tx_id is None and not self._tx_state.dead:
24662465
return _utilities.wrap_result_in_future(self)
@@ -2485,8 +2484,7 @@ def async_rollback(self, settings=None):
24852484
24862485
:return: A future of rollback call
24872486
"""
2488-
self._check_split()
2489-
self._finished = True
2487+
self._set_finish(self._ROLLBACK)
24902488

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

0 commit comments

Comments
 (0)