Closed kanishthkarthik closed 4 months ago
Thanks for reaching out. This is the expected behavior. The Boto3 batch_get_item command involves a call to the underlying DynamoDB BatchGetItem API in which the ValidationException
occurs. As mentioned in the documentation for Keys
:
Keys
- An array of primary key attribute values that define specific items in the table...
So Keys
should correspond to specific items, and therefore duplicates cannot be used here. Hope that helps, if you have any follow up questions let us know. I'm going to convert this do a discussion as it is not a bug.
And if you think the documentation could be improved here please use the Provide feedback at the bottom of the API documentation page to reach the appropriate team. Any updates to the API docs will be updated in Boto3 automatically.
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.
Describe the bug
Invoking batch_get_item with duplicate keys results in a ValidationException. I could not find a reference to this error either in the boto3 documentation or in the AWS Docs for BatchGetItem. Is this an expected behavior?
Expected Behavior
A ValidationException is not raised or the behavior is documented.
Current Behavior
Invoking batch_get_item with duplicate keys results in a ValidationException.
Reproduction Steps
The above snippet raises:
ClientError: An error occurred (ValidationException) when calling the BatchGetItem operation: Provided list of item keys contains duplicates
Possible Solution
The behavior can be detailed in the documentation.
Additional Information/Context
No response
SDK version used
1.34.76
Environment details (OS name and version, etc.)
macOS 14.4.1