Skip to content
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.Table.get_item behavior incorrectly specified when no item with the given key is present #4101

Closed
SamStephens opened this issue Apr 26, 2024 · 2 comments
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@SamStephens
Copy link

Describe the issue

The documentation for this method says

The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data and there will be no Item element in the response.

However, I have just tried get_item with a key that is not present, and I did not get a response with no Item element. Instead the error

botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the GetItem operation: Requested resource not found

Was thrown.

I suspect the documentation I'm quoting is describing how the API behaves, and that boto3 has some behavior in front of that to throw a ResourceNotFoundException that the documentation should instead reflect.

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/get_item.html

@SamStephens SamStephens added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Apr 26, 2024
@SamStephens
Copy link
Author

This is my bad, the resource being referred to is the table, not the item.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant