We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49d9503 commit 4d853dcCopy full SHA for 4d853dc
gcloud/datastore/query.py
@@ -467,7 +467,9 @@ def __iter__(self):
467
if self._limit is not None:
468
self._limit -= num_results
469
if self._offset is not None:
470
- self._offset += num_results
+ # NOTE: The offset goes down relative to the location
471
+ # because we are updating the cursor each time.
472
+ self._offset -= num_results
473
self.next_page()
474
475
gcloud/datastore/test_query.py
@@ -565,7 +565,7 @@ def test___iter___w_limit(self):
565
qpb2 = _pb_from_query(query)
566
qpb2.start_cursor = self._END
567
qpb2.limit.value = 1
568
- qpb2.offset = 14
+ qpb2.offset = 12
569
EXPECTED1 = {
570
'project': self._PROJECT,
571
'query_pb': qpb1,
0 commit comments