File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ 3.22.0
2
+ ======
3
+ UNRELEASED
4
+
5
+ Features
6
+ --------
7
+ * Add all() function to the ResultSet API (PYTHON-1203)
8
+
1
9
3.21.0
2
10
======
3
11
January 15, 2020
31
39
* Remove *read_repair_chance table options (PYTHON-1140)
32
40
* Avoid warnings about unspecified load balancing policy when connecting to a cloud cluster (PYTHON-1177)
33
41
* Add new DSE CQL keywords (PYTHON-1122)
42
+ * Publish binary wheel distributions (PYTHON-1013)
34
43
35
44
Deprecations
36
45
------------
Original file line number Diff line number Diff line change @@ -4934,6 +4934,15 @@ def current_rows(self):
4934
4934
"""
4935
4935
return self ._current_rows or []
4936
4936
4937
+ def all (self ):
4938
+ """
4939
+ Returns all the remaining rows as a list. This is basically
4940
+ a convenient shortcut to `list(result_set)`.
4941
+
4942
+ This function is not recommended for queries that return a large number of elements.
4943
+ """
4944
+ return list (self )
4945
+
4937
4946
def one (self ):
4938
4947
"""
4939
4948
Return a single row of the results or None if empty. This is basically
Original file line number Diff line number Diff line change @@ -195,6 +195,13 @@ def test_one(self):
195
195
196
196
self .assertEqual (rs .one (), first )
197
197
198
+ def test_all (self ):
199
+ first , second = Mock (), Mock ()
200
+ rs1 = ResultSet (Mock (has_more_pages = False ), [first , second ])
201
+ rs2 = ResultSet (Mock (has_more_pages = False ), [first , second ])
202
+
203
+ self .assertEqual (rs1 .all (), list (rs2 ))
204
+
198
205
@patch ('cassandra.cluster.warn' )
199
206
def test_indexing_deprecation (self , mocked_warn ):
200
207
# normally we'd use catch_warnings to test this, but that doesn't work
You can’t perform that action at this time.
0 commit comments