Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions datastore/google/cloud/datastore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@


_NOT_FINISHED = query_pb2.QueryResultBatch.NOT_FINISHED
_NO_MORE_RESULTS = query_pb2.QueryResultBatch.NO_MORE_RESULTS

_FINISHED = (
query_pb2.QueryResultBatch.NO_MORE_RESULTS,
_NO_MORE_RESULTS,
query_pb2.QueryResultBatch.MORE_RESULTS_AFTER_LIMIT,
query_pb2.QueryResultBatch.MORE_RESULTS_AFTER_CURSOR,
)
Expand Down Expand Up @@ -470,7 +471,7 @@ def _process_query_results(self, response_pb):
"""
self._skipped_results = response_pb.batch.skipped_results

if response_pb.batch.end_cursor == b'': # Empty-value for bytes.
if response_pb.batch.more_results == _NO_MORE_RESULTS:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

self.next_page_token = None
else:
self.next_page_token = base64.urlsafe_b64encode(
Expand Down
2 changes: 1 addition & 1 deletion datastore/tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def test__process_query_results_done(self):
entity_pbs = [
_make_entity('World', 1234, 'PROJECT'),
]
cursor_as_bytes = b''
cursor_as_bytes = b'\x9ai\xe7'
skipped_results = 44
more_results_enum = query_pb2.QueryResultBatch.NO_MORE_RESULTS
response_pb = _make_query_response(
Expand Down