Set next_page_token to none if there are no more result#4349
Conversation
1078441 to
05893ad
Compare
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
FYI, I've tested the change against our tests which were previously failing. The patch has fixed the problem. |
05893ad to
9c0d881
Compare
Response ``end_cursor`` might be non-empty as reported in googleapis#4347.
Depending on empty value of ``response_pb.batch.end_cursor`` is not reliable as the behaviour is not documented. It's better to check API response field ``moreResults``, see https://cloud.google.com/datastore/docs/reference/rpc/google.datastore.v1#google.datastore.v1.QueryResultBatch.
9c0d881 to
622078d
Compare
|
@dhermes how does it look? This is currently blocker for migration to |
|
@mathewcohle RE: "how does it look?" The code looks fine, but my previous sentiment is unchanged:
|
|
@mathewcohle Thank you for the patch! |
|
Sorry: everything was green on the last commit in the PR, and you said you were waiting on signoff from the back-end team, which we got. |
* Update _process_query_results_done Datastore test Response ``end_cursor`` might be non-empty as reported in #4347. * Set next_page_token to None using MoreResults enum (#4347) Depending on empty value of ``response_pb.batch.end_cursor`` is not reliable as the behaviour is not documented. It's better to check API response field ``moreResults``, see https://cloud.google.com/datastore/docs/reference/rpc/google.datastore.v1#google.datastore.v1.QueryResultBatch.
Depending on empty value of
response_pb.batch.end_cursoris not reliable as the behaviour is not documented. It's better to check API response fieldmoreResults, seehttps://cloud.google.com/datastore/docs/reference/rpc/google.datastore.v1#google.datastore.v1.QueryResultBatch.
Closes #4347.