@@ -714,10 +714,16 @@ def set_table_name(self, table_name):
714
714
715
715
def set_return_row (self , return_row ):
716
716
"""
717
- Sets whether information about the existing row should be returned on
718
- failure because of a version mismatch. If a match version has not been
719
- set via :py:meth:`set_match_version` this parameter is ignored and there
720
- will be no return information. This parameter is optional and defaults
717
+ Sets whether information about the existing row should be returned.
718
+ If set to true existing row information is returned if one of the
719
+ following occurs:
720
+
721
+ PutOption.IF_VERSION is used and the operation fails because
722
+ the row exists and its version does not match.\n
723
+ PutOption.IF_VERSION is not used and the operation succeeds
724
+ provided that the server supports providing the existing row.
725
+
726
+ This parameter is optional and defaults
721
727
to False. It's use may incur additional cost.
722
728
723
729
:param return_row: set to True if information should be returned.
@@ -1945,9 +1951,17 @@ class PutRequest(WriteRequest):
1945
1951
specific :py:class:`Version`. Use PutOption.IF_VERSION for this case and
1946
1952
:py:meth:`set_match_version` to specify the version to match.
1947
1953
1948
- Information about the existing row can be returned on failure of a put
1949
- operation using PutOption.IF_VERSION or PutOption.IF_ABSENT by using
1950
- :py:meth:`set_return_row`. Requesting this information incurs additional
1954
+ Information about the existing row can be optionally returned if
1955
+ :py:meth:`set_return_row` is set to true and one of the following occurs:
1956
+
1957
+ PutOption.IF_ABSENT is used and the operation fails because
1958
+ the row already exists.\n
1959
+ PutOption.IF_VERSION is used and the operation fails because
1960
+ the row exists and its version does not match.\n
1961
+ PutOption.IF_PRESENT is used and the operation succeeds
1962
+ provided that the server supports providing the existing row.
1963
+
1964
+ Requesting this information incurs additional
1951
1965
cost and may affect operation latency.
1952
1966
1953
1967
On a successful operation the :py:class:`Version` returned by
@@ -2269,9 +2283,19 @@ def set_table_name(self, table_name):
2269
2283
2270
2284
def set_return_row (self , return_row ):
2271
2285
"""
2272
- Sets whether information about the exist row should be returned on
2273
- failure because of a version mismatch or failure of an "if absent"
2274
- operation.
2286
+ Sets whether information about the exist row should be returned.
2287
+ If set to true, information about the existing row will be returned
2288
+ if one of the following occurs:
2289
+
2290
+ PutOption.IF_ABSENT is used and the operation fails because
2291
+ the row already exists.\n
2292
+ PutOption.IF_VERSION is used and the operation fails because
2293
+ the row exists and its version does not match.\n
2294
+ PutOption.IF_PRESENT is used and the operation succeeds
2295
+ provided that the server supports providing the existing row.
2296
+
2297
+ Requesting this information incurs additional
2298
+ cost and may affect operation latency.
2275
2299
2276
2300
:param return_row: set to True if information should be returned.
2277
2301
:type return_row: bool
@@ -2284,11 +2308,7 @@ def set_return_row(self, return_row):
2284
2308
2285
2309
def get_return_row (self ):
2286
2310
"""
2287
- Returns whether information about the exist row should be returned on
2288
- failure because of a version mismatch or failure of an "if absent"
2289
- operation. If no option is set via :py:meth:`set_option` or the option
2290
- is PutOption.IF_PRESENT the value of this parameter is ignored and there
2291
- will not be any return information.
2311
+ Returns whether information about the exist row should be returned.
2292
2312
2293
2313
:returns: True if information should be returned.
2294
2314
:rtype: bool
@@ -4738,7 +4758,8 @@ class DeleteResult(WriteResult):
4738
4758
4739
4759
If the delete succeeded :py:meth:`get_success` returns True. Information
4740
4760
about the existing row on failure may be available using
4741
- :py:meth:`get_existing_value` and :py:meth:`get_existing_version`, depending
4761
+ :py:meth:`get_existing_value`, :py:meth:`get_existing_version` and
4762
+ :py:meth:`get_existing_modification_time`, depending
4742
4763
on the use of :py:meth:`DeleteRequest.set_return_row`.
4743
4764
"""
4744
4765
@@ -4764,11 +4785,9 @@ def get_success(self):
4764
4785
4765
4786
def get_existing_value (self ):
4766
4787
"""
4767
- Returns the existing row value if available. It will be available if the
4768
- target row exists and the operation failed because of a
4769
- :py:class:`Version` mismatch and the corresponding
4770
- :py:class:`DeleteRequest` the method
4771
- :py:meth:`DeleteRequest.set_return_row` was called with a True value.
4788
+ Returns the existing row value if available. See
4789
+ :py:meth:`DeleteRequest.set_return_row` for conditions under which
4790
+ the information is available.
4772
4791
4773
4792
:returns: the value.
4774
4793
:rtype: dict
@@ -4777,11 +4796,9 @@ def get_existing_value(self):
4777
4796
4778
4797
def get_existing_version (self ):
4779
4798
"""
4780
- Returns the existing row :py:class:`Version` if available. It will be
4781
- available if the target row exists and the operation failed because of a
4782
- :py:class:`Version` mismatch and the corresponding
4783
- :py:class:`DeleteRequest` the method
4784
- :py:meth:`DeleteRequest.set_return_row` was called with a True value.
4799
+ Returns the existing row :py:class:`Version` if available. See
4800
+ :py:meth:`DeleteRequest.set_return_row` for conditions under which
4801
+ the information is available.
4785
4802
4786
4803
:returns: the version.
4787
4804
:rtype: Version
@@ -4790,11 +4807,9 @@ def get_existing_version(self):
4790
4807
4791
4808
def get_existing_modification_time (self ):
4792
4809
"""
4793
- Returns the existing row modification time if available. It will be
4794
- available if the target row exists and the operation failed because of a
4795
- :py:class:`Version` mismatch and the corresponding
4796
- :py:class:`DeleteRequest` the method
4797
- :py:meth:`DeleteRequest.set_return_row` was called with a True value.
4810
+ Returns the existing row modification time if available. See
4811
+ :py:meth:`DeleteRequest.set_return_row` for conditions under which
4812
+ the information is available.
4798
4813
4799
4814
:returns: the modification time in milliseconds since January 1, 1970
4800
4815
:rtype: int
@@ -5210,10 +5225,18 @@ class PutResult(WriteResult):
5210
5225
5211
5226
On a successful operation the value returned by :py:meth:`get_version`
5212
5227
is non-none. On failure that value is None. Information about the existing
5213
- row on failure may be available using :py:meth:`get_existing_value` and
5214
- :py:meth:`get_existing_version`, depending on the use of
5215
- :py:meth:`PutRequest.set_return_row` and whether the put had an option set
5216
- using :py:meth:`PutRequest.set_option`.
5228
+ row may be available if :py:meth:`PutRequest.set_return_row` is set to
5229
+ true and one of the following occurs:
5230
+
5231
+ PutOption.IF_ABSENT is used and the operation fails because
5232
+ the row already exists.\n
5233
+ PutOption.IF_VERSION is used and the operation fails because
5234
+ the row exists and its version does not match.\n
5235
+ PutOption.IF_PRESENT is used and the operation succeeds
5236
+ provided that the server supports providing the existing row.\n
5237
+ PutOption is not used and put operation replaces the
5238
+ existing row provided that the server supports providing the existing
5239
+ row.
5217
5240
"""
5218
5241
5219
5242
def __init__ (self ):
@@ -5256,10 +5279,9 @@ def get_generated_value(self):
5256
5279
5257
5280
def get_existing_version (self ):
5258
5281
"""
5259
- Returns the existing row :py:class:`Version` if available. This value
5260
- will only be available if the conditional put operation failed and the
5261
- request specified that return information be returned using
5262
- :py:meth:`PutRequest.set_return_row`.
5282
+ Returns the existing row :py:class:`Version` if available. See
5283
+ :py:meth:`PutRequest.set_return_row` for conditions under which
5284
+ the information is available.
5263
5285
5264
5286
:returns: the :py:class:`Version`.
5265
5287
:rtype: Version
@@ -5268,10 +5290,9 @@ def get_existing_version(self):
5268
5290
5269
5291
def get_existing_value (self ):
5270
5292
"""
5271
- Returns the existing row value if available. This value will only be
5272
- available if the conditional put operation failed and the request
5273
- specified that return information be returned using
5274
- :py:meth:`PutRequest.set_return_row`.
5293
+ Returns the existing row value if available. See
5294
+ :py:meth:`PutRequest.set_return_row` for conditions under which
5295
+ the information is available.
5275
5296
5276
5297
:returns: the value.
5277
5298
:rtype: dict
@@ -5280,11 +5301,9 @@ def get_existing_value(self):
5280
5301
5281
5302
def get_existing_modification_time (self ):
5282
5303
"""
5283
- Returns the existing row modification time if available. It will be
5284
- available if the conditional put operation failed and the request
5285
- specified that return information be returned using
5286
- :py:meth:`PutRequest.set_return_row`. A value of -1 indicates this
5287
- feature is not available at the connected server.
5304
+ Returns the existing row modification timeif available. See
5305
+ :py:meth:`PutRequest.set_return_row` for conditions under which
5306
+ the information is available.
5288
5307
5289
5308
:returns: the modification time in milliseconds since January 1, 1970
5290
5309
:rtype: int
@@ -6549,9 +6568,9 @@ def get_existing_version(self):
6549
6568
6550
6569
def get_existing_value (self ):
6551
6570
"""
6552
- Returns the previous row value associated with the key if available.
6571
+ Returns the existing row value associated with the key if available.
6553
6572
6554
- :returns: the previous row value
6573
+ :returns: the existing row value
6555
6574
:rtype: dict
6556
6575
"""
6557
6576
return self ._get_existing_value ()
0 commit comments