get_query_trace() contract is ambiguous

Description

The documentation for ResponseFuture.get_query_trace states

Thus, the following code

should return a trace or raise TraceUnavailable. Instead, it is returning None even though trace was set to True in the call to execute_async.

If I step into the driver code with ipdb, it is happening at this check:

This is because the future has not returned yet, and calling future.result() first will solve the issue. This is not clear in the documentation. The use of max_wait implies (at least to me, and potentially to other users) it would wait for a trace to become available, including waiting for the future to return. Since I assume changing the function is architecturally difficult, it would be nice if the docs mentioned that future.result() must be called before calling get_query_trace()

Environment

OSX

Pull Requests

None

Activity

Show:
Jaume Marhuenda
April 28, 2017, 1:26 PM

Added test here. Moving to done

Fixed

Assignee

Unassigned

Reporter

Philip Thompson

Fix versions

Labels

None

PM Priority

C

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

Py P-NEXT

Affects versions

Priority

Minor
Configure