Open mdavis-xyz opened 1 year ago
Thanks @mdavis-xyz for reporting this issue. As mentioned in https://github.com/boto/boto3/issues/3677 there are inconsistencies with how continuation tokens are named across services, but I agree it's confusing to have NextToken
documented when that's not in the response. Maybe it should say something like "(e.g. NexToken
, though the name may vary depending on the service)".
Here is the documentation for the scan
client method: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/scan.html. As noted there, ExclusiveStartKey
is used for LastEvaluatedKey
— here is an example use case. I think it is unusual to have a dict as a next marker as those tokens are generally strings.
I've referenced this issue in https://github.com/boto/boto3/issues/3677 for further review going forward.
tldr: The pagination token returned by dynamodb paginators doesn't match the documentation, and cannot be passed in as a starting point for pagination.
Docs Issue
The docs for dynamodb paginators say each page contains
NextToken
. But it's actuallyLastEvaluatedKey
.Similar to #3677 and #1664
Steps to reproduce:
Code Issue
If you try to take this
LastEvaluatedKey
and pass it to theStartingToken
field of the paginator, you get an error. BecauseLastEvaluatedKey
is not a string, it's a dict.If I add
json.dumps()
to the key, I get:Links
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/paginator/Scan.html