You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/transaction.rst
+15-10Lines changed: 15 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Transact Writes
30
30
31
31
A :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` can be initialized with the following parameters:
32
32
33
-
* ``connection`` (required) - the :py:class:`Connection <pynamodb.connection.base.Connection>` used to make the request (see :ref:`low_level`)
33
+
* ``connection`` (required) - the :py:class:`Connection <pynamodb.connection.base.Connection>` used to make the request (see :ref:`low-level`)
34
34
* ``client_request_token`` - an idempotency key for the request (see `ClientRequestToken <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ClientRequestToken>`_ in the DynamoDB API reference)
35
35
* ``return_consumed_capacity`` - determines the level of detail about provisioned throughput consumption that is returned in the response (see `ReturnConsumedCapacity <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ReturnConsumedCapacity>`_ in the DynamoDB API reference)
36
36
* ``return_item_collection_metrics`` - determines whether item collection metrics are returned (see `ReturnItemCollectionMetrics <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#DDB-TransactWriteItems-request-ReturnItemCollectionMetrics>`_ in the DynamoDB API reference)
@@ -118,12 +118,12 @@ Condition Check
118
118
119
119
The ``ConditionCheck`` operation is used on a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` to check if the current state of a record you
120
120
aren't modifying within the overall transaction fits some criteria that, if it fails, would cause the entire
121
-
transaction to fail. The ``condition`` argument is of type :ref:`conditional`.
121
+
transaction to fail. The ``condition`` argument is of type :ref:`conditional_operations`.
122
122
123
123
* ``model_cls`` (required)
124
124
* ``hash_key`` (required)
125
125
* ``range_key`` (optional)
126
-
* ``condition`` (required) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
126
+
* ``condition`` (required) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
127
127
128
128
.. code-block:: python
129
129
@@ -137,7 +137,7 @@ Delete
137
137
The ``Delete`` operation functions similarly to ``Model.delete``.
138
138
139
139
* ``model`` (required)
140
-
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
140
+
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
141
141
142
142
.. code-block:: python
143
143
@@ -154,8 +154,8 @@ Save
154
154
The ``Put`` operation functions similarly to ``Model.save``.
155
155
156
156
* ``model`` (required)
157
-
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
158
-
* ``return_values`` (optional) - the values that should be returned if the condition fails ((see `ReturnValuesOnConditionCheckFailure <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Put.html#DDB-Type-Put-ReturnValuesOnConditionCheckFailure>`_ in the DynamoDB API reference)
157
+
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
158
+
* ``return_values`` (optional) - the values that should be returned if the condition fails ((see `PutReturnValuesOnConditionCheckFailure`_ in the DynamoDB API reference)
159
159
160
160
.. code-block:: python
161
161
@@ -172,8 +172,8 @@ The ``Update`` operation functions similarly to ``Model.update``.
172
172
173
173
* ``model`` (required)
174
174
* ``actions`` (required) - a list of type :py:class:`Action <pynamodb.expressions.update.Action>` (see :ref:`updates`)
175
-
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional`)
176
-
* ``return_values`` (optional) - the values that should be returned if the condition fails (see `ReturnValuesOnConditionCheckFailure <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Update.html#DDB-Type-Update-ReturnValuesOnConditionCheckFailure>`_ in the DynamoDB API reference)
175
+
* ``condition`` (optional) - of type :py:class:`Condition <pynamodb.expressions.condition.Condition>` (see :ref:`conditional_operations`)
176
+
* ``return_values`` (optional) - the values that should be returned if the condition fails (see `UpdateReturnValuesOnConditionCheckFailure`_ in the DynamoDB API reference)
177
177
178
178
179
179
.. code-block:: python
@@ -215,6 +215,11 @@ Error Types
215
215
216
216
You can expect some new error types with transactions, such as:
217
217
218
-
* :py:exc:`TransactWriteError <pynamodb.exceptions.TransactWriteError>` - thrown when a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` request returns a bad response (see the `Errors <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html#API_TransactWriteItems_Errors>`_ section in the DynamoDB API reference).
219
-
* :py:exc:`TransactGetError <pynamodb.exceptions.TransactGetError>` - thrown when a :py:class:`TransactGet <pynamodb.transactions.TransactGet>` request returns a bad response (see the `Errors <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html#API_TransactGetItems_Errors>`_ section in the DynamoDB API reference).
218
+
* :py:exc:`TransactWriteError <pynamodb.exceptions.TransactWriteError>` - thrown when a :py:class:`TransactWrite <pynamodb.transactions.TransactWrite>` request returns a bad response (see the `TransactWriteItems Errors`_ section in the DynamoDB API reference).
219
+
* :py:exc:`TransactGetError <pynamodb.exceptions.TransactGetError>` - thrown when a :py:class:`TransactGet <pynamodb.transactions.TransactGet>` request returns a bad response (see the `TransactGetItems Errors`_ section in the DynamoDB API reference).
220
220
* :py:exc:`InvalidStateError <pynamodb.exceptions.InvalidStateError>` - thrown when an attempt is made to access data on a :py:class:`_ModelFuture <pynamodb.models._ModelFuture>` before the `TransactGet` request is completed.
0 commit comments