Skip to content

Commit 0fcd4b9

Browse files
authored
flesh out ResultSet upgrade guide (scylladb#796)
PYTHON-464
1 parent f7881d9 commit 0fcd4b9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

docs/upgrading.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@ materialize a list using the iterator:
4646
results = session.execute("SELECT * FROM system.local")
4747
row_list = list(results)
4848
49-
For backward compatability, :class:`~.ResultSet` supports indexing. If
50-
the result is paged, all pages will be materialized. A warning will
51-
be logged if a paged query is implicitly materialized.
49+
For backward compatability, :class:`~.ResultSet` supports indexing. When
50+
accessed at an index, a `~.ResultSet` object will materialize all its pages:
51+
52+
.. code-block:: python
53+
54+
results = session.execute("SELECT * FROM system.local")
55+
first_result = results[0] # materializes results, fetching all pages
56+
57+
This can send requests and load (possibly large) results into memory, so
58+
`~.ResultSet` will log a warning on implicit materialization.
5259

5360
Trace information is not attached to executed Statements
5461
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)