Skip to content

Commit 031ebb0

Browse files
committed
Remove deprecated ResponseFuture timeout parameter
1 parent 75ddc51 commit 031ebb0

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

cassandra/cluster.py

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,26 +3147,14 @@ def _retry_task(self, reuse_connection):
31473147
# otherwise, move onto another host
31483148
self.send_request()
31493149

3150-
def result(self, timeout=_NOT_SET):
3150+
def result(self):
31513151
"""
31523152
Return the final result or raise an Exception if errors were
31533153
encountered. If the final result or error has not been set
3154-
yet, this method will block until that time.
3155-
3156-
.. versionchanged:: 2.6.0
3157-
3158-
**`timeout` is deprecated. Use timeout in the Session execute functions instead.
3159-
The following description applies to deprecated behavior:**
3160-
3161-
You may set a timeout (in seconds) with the `timeout` parameter.
3162-
By default, the :attr:`~.default_timeout` for the :class:`.Session`
3163-
this was created through will be used for the timeout on this
3164-
operation.
3165-
3166-
This timeout applies to the entire request, including any retries
3167-
(decided internally by the :class:`.policies.RetryPolicy` used with
3168-
the request).
3154+
yet, this method will block until it is set, or the timeout
3155+
set for the request expires.
31693156
3157+
Timeout is specified in the Session request execution functions.
31703158
If the timeout is exceeded, an :exc:`cassandra.OperationTimedOut` will be raised.
31713159
This is a client-side timeout. For more information
31723160
about server-side coordinator timeouts, see :class:`.policies.RetryPolicy`.
@@ -3184,18 +3172,7 @@ def result(self, timeout=_NOT_SET):
31843172
... log.exception("Operation failed:")
31853173
31863174
"""
3187-
if timeout is not _NOT_SET and not ResponseFuture._warned_timeout:
3188-
msg = "ResponseFuture.result timeout argument is deprecated. Specify the request timeout via Session.execute[_async]."
3189-
warnings.warn(msg, DeprecationWarning)
3190-
log.warning(msg)
3191-
ResponseFuture._warned_timeout = True
3192-
else:
3193-
timeout = None
3194-
3195-
self._event.wait(timeout)
3196-
# TODO: remove this conditional when deprecated timeout parameter is removed
3197-
if not self._event.is_set():
3198-
self._on_timeout()
3175+
self._event.wait()
31993176
if self._final_result is not _NOT_SET:
32003177
if self._paging_state is None:
32013178
return self._final_result

tests/integration/standard/test_custom_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,6 @@ def execute_async_validate_custom_payload(self, statement, custom_payload):
162162
# Submit the statement with our custom payload. Validate the one
163163
# we receive from the server matches
164164
response_future = self.session.execute_async(statement, custom_payload=custom_payload)
165-
response_future.result(timeout=10.0)
165+
response_future.result()
166166
returned_custom_payload = response_future.custom_payload
167167
self.assertEqual(custom_payload, returned_custom_payload)

tests/integration/standard/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_client_ip_in_trace(self):
137137
query = "SELECT * FROM system.local"
138138
statement = SimpleStatement(query)
139139
response_future = session.execute_async(statement, trace=True)
140-
response_future.result(timeout=10.0)
140+
response_future.result()
141141

142142
# Fetch the client_ip from the trace.
143143
trace = response_future.get_query_trace(max_wait=2.0)

0 commit comments

Comments
 (0)