A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/datastax/python-driver/commit/031ebb0 below:

Remove deprecated ResponseFuture timeout parameter · datastax/python-driver@031ebb0 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+7

-30

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+7

-30

lines changed Original file line number Diff line number Diff line change

@@ -3147,26 +3147,14 @@ def _retry_task(self, reuse_connection):

3147 3147

# otherwise, move onto another host

3148 3148

self.send_request()

3149 3149 3150 -

def result(self, timeout=_NOT_SET):

3150 +

def result(self):

3151 3151

"""

3152 3152

Return the final result or raise an Exception if errors were

3153 3153

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.

3169 3156 3157 +

Timeout is specified in the Session request execution functions.

3170 3158

If the timeout is exceeded, an :exc:`cassandra.OperationTimedOut` will be raised.

3171 3159

This is a client-side timeout. For more information

3172 3160

about server-side coordinator timeouts, see :class:`.policies.RetryPolicy`.

@@ -3184,18 +3172,7 @@ def result(self, timeout=_NOT_SET):

3184 3172

... log.exception("Operation failed:")

3185 3173 3186 3174

"""

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()

3199 3176

if self._final_result is not _NOT_SET:

3200 3177

if self._paging_state is None:

3201 3178

return self._final_result

Original file line number Diff line number Diff line change

@@ -162,6 +162,6 @@ def execute_async_validate_custom_payload(self, statement, custom_payload):

162 162

# Submit the statement with our custom payload. Validate the one

163 163

# we receive from the server matches

164 164

response_future = self.session.execute_async(statement, custom_payload=custom_payload)

165 -

response_future.result(timeout=10.0)

165 +

response_future.result()

166 166

returned_custom_payload = response_future.custom_payload

167 167

self.assertEqual(custom_payload, returned_custom_payload)

Original file line number Diff line number Diff line change

@@ -137,7 +137,7 @@ def test_client_ip_in_trace(self):

137 137

query = "SELECT * FROM system.local"

138 138

statement = SimpleStatement(query)

139 139

response_future = session.execute_async(statement, trace=True)

140 -

response_future.result(timeout=10.0)

140 +

response_future.result()

141 141 142 142

# Fetch the client_ip from the trace.

143 143

trace = response_future.get_query_trace(max_wait=2.0)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4