-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynamoDB paginator fails when partition key is of type number #2932
Comments
Hi @twitu, Thanks for pointing this out. I can definitely see where this could cause some problems. Would you be able to provide debug logs by adding |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
I've added debug logs here. This is from running the function in a vanilla Python3.8 Lambda.
|
I have a specific use case where I want In the pseudocode below I just set the
|
I don't see why that's the case. It's possible to handle encoding |
seems to work (ETA: well, you'd also want to update the second call to |
Up. Also having this issue. Unfortunately, the fix proposed by @twitu does not work with a large number of items, since boto seems to self paginate. However, it does works for a small number of items. Any update @stobrien89 ? Anyway, thanks for your time and sweat. |
Describe the bug
Pagination for dynamodb fails when the partition key is of type number.
This happens because the returned LastEvaluatedKey is of type
Decimal
and it cannot be json encoded (json.dumps
fails). This happens inbotocore.paginate.encode
it tries to do convert the token to string.This issue talks about the issue with
Decimal
types. The gist is that a Number type is returned like this{ value: 3}
->{ value: { N: Decimal("3")}}
. This cannot be converted to string by json.Steps to reproduce
Expected behavior
Pagination should succeed. It should handle the
Decimal
type by itself.The text was updated successfully, but these errors were encountered: