Skip to content

fix(dynamodb): split read_items keys into BatchGetItem requests of at most 100 - #3518

Merged
kukushking merged 2 commits into
aws:mainfrom
sebxt:fix/dynamodb-read-items-over-100-keys
Oct 25, 2026
Merged

kukushking merged 2 commits into
aws:mainfrom
sebxt:fix/dynamodb-read-items-over-100-keys

Conversation

@sebxt

@sebxt sebxt commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Feature or Bugfix

  • Bugfix

Detail

  • wr.dynamodb.read_items sent all partition_values in one BatchGetItem request. DynamoDB rejects requests with more than 100 keys, so reading 101 or more keys raised a ValidationException.
  • _read_batch_items_chunked now sends the keys in slices of 100 and handles UnprocessedKeys for each slice, yielding one chunk per response as before.
  • Added test_dynamodb_read_items_more_than_100_partition_values in tests/unit/test_moto.py (chunked and non chunked). It fails on main with the ValidationException and passes with the fix. tests/unit/test_moto.py, test_utils.py, test_metadata.py, test_session.py, test_data_quality_rules.py and test_bedrock_mocked.py pass locally; ruff format --check, ruff check and mypy awswrangler report nothing new.

Relates

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… most 100

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
@kukushking
kukushking force-pushed the fix/dynamodb-read-items-over-100-keys branch from 72f86dd to 00e45e0 Compare October 25, 2026 00:25
@kukushking

Copy link
Copy Markdown
Collaborator

Thanks @sebxt !

@kukushking
kukushking merged commit 6e45f9f into aws:main Oct 25, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wr.dynamodb.read_items fails with ValidationException when more than 100 partition_values are passed

2 participants