You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2021/06/10 16:45:30 UTC

[ignite-python-thin-client] branch master updated: Fix async transactions code example in docs

This is an automated email from the ASF dual-hosted git repository.

ivandasch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-python-thin-client.git


The following commit(s) were added to refs/heads/master by this push:
     new c64fb10  Fix async transactions code example in docs
c64fb10 is described below

commit c64fb1099f99fcf073d2b8eacc486f103da9adf9
Author: Ivan Daschinsky <iv...@apache.org>
AuthorDate: Thu Jun 10 19:44:56 2021 +0300

    Fix async transactions code example in docs
---
 docs/async_examples.rst  | 10 +++++-----
 examples/transactions.py |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/async_examples.rst b/docs/async_examples.rst
index 322869c..5e60c70 100644
--- a/docs/async_examples.rst
+++ b/docs/async_examples.rst
@@ -90,35 +90,35 @@ Let's create transactional cache:
 .. literalinclude:: ../examples/transactions.py
   :language: python
   :dedent: 8
-  :lines: 29-32
+  :lines: 30-33
 
 Let's start a transaction and commit it:
 
 .. literalinclude:: ../examples/transactions.py
   :language: python
   :dedent: 8
-  :lines: 35-40
+  :lines: 36-41
 
 Let's check that the transaction was committed successfully:
 
 .. literalinclude:: ../examples/transactions.py
   :language: python
   :dedent: 8
-  :lines: 42-44
+  :lines: 44-45
 
 Let's check that raising exception inside `async with` block leads to transaction's rollback
 
 .. literalinclude:: ../examples/transactions.py
   :language: python
   :dedent: 8
-  :lines: 47-58
+  :lines: 48-59
 
 Let's check that timed out transaction is successfully rolled back
 
 .. literalinclude:: ../examples/transactions.py
   :language: python
   :dedent: 8
-  :lines: 61-72
+  :lines: 62-73
 
 See more info about transaction's parameters in a documentation of :py:meth:`~pyignite.aio_client.AioClient.tx_start`
 
diff --git a/examples/transactions.py b/examples/transactions.py
index 895837c..a0c90ba 100644
--- a/examples/transactions.py
+++ b/examples/transactions.py
@@ -69,7 +69,7 @@ async def async_example():
             print(e)
 
         # key=1 value=success
-        val = await cache.get(1)
+        val = await cache.get(key)
         print(f"key=1 value={val}")
 
         # destroy cache