@@ -124,14 +124,14 @@ def test_firestore_aggregation_query_generators(collection, assert_trace_for_gen
124
124
def patch_partition_queries (monkeypatch , client , collection , sample_data ):
125
125
"""
126
126
Partitioning is not implemented in the Firestore emulator.
127
-
127
+
128
128
Ordinarily this method would return a generator of Cursor objects. Each Cursor must point at a valid document path.
129
- To test this, we can patch the RPC to return 1 Cursor which is pointed at any document available.
129
+ To test this, we can patch the RPC to return 1 Cursor which is pointed at any document available.
130
130
The get_partitions will take that and make 2 QueryPartition objects out of it, which should be enough to ensure
131
131
we can exercise the generator's tracing.
132
132
"""
133
- from google .cloud .firestore_v1 .types .query import Cursor
134
133
from google .cloud .firestore_v1 .types .document import Value
134
+ from google .cloud .firestore_v1 .types .query import Cursor
135
135
136
136
subcollection = collection .document ("subcollection" ).collection ("subcollection1" )
137
137
documents = [d for d in subcollection .list_documents ()]
@@ -190,5 +190,6 @@ def _test():
190
190
@background_task ()
191
191
def test_firestore_collection_group_generators (collection , assert_trace_for_generator , patch_partition_queries ):
192
192
from google .cloud .firestore import CollectionGroup
193
+
193
194
collection_group = CollectionGroup (collection )
194
195
assert_trace_for_generator (collection_group .get_partitions , 1 )
0 commit comments