diff --git a/cassandra/cluster.py b/cassandra/cluster.py index 28885ae9..7d982e15 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -2677,6 +2677,17 @@ class ResponseFuture(object): @property def custom_payload(self): + """ + The custom payload returned from the server, if any. This will only be + set by Cassandra servers implementing a custom QueryHandler, and only + for protocol_version 4+. + + Ensure the future is complete before trying to access this property + (call :meth:`.result()`, or after callback is invoked). + Otherwise it may throw if the response has not been received. + + :return: :ref:`custom_payload`. + """ if not self._event.is_set(): raise Exception("custom_payload cannot be retrieved before ResponseFuture is finalized") return self._custom_payload diff --git a/docs/api/cassandra/cluster.rst b/docs/api/cassandra/cluster.rst index 6532c9a0..e6e3cf76 100644 --- a/docs/api/cassandra/cluster.rst +++ b/docs/api/cassandra/cluster.rst @@ -102,6 +102,8 @@ .. automethod:: get_query_trace() + .. autoattribute:: custom_payload() + .. autoattribute:: has_more_pages .. automethod:: start_fetching_next_page()