-
Notifications
You must be signed in to change notification settings - Fork 700
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
DescribeTable
call hidden in read_items
#2396
Comments
Hey, More than 100 items can be returned by However, I do see the case for allowing a customer to provide Best regards, |
@mooreniemi can you expand on this please:
as Leon mentioned |
Jump in just to (hopefully) clarify what @mooreniemi is referring to. The usage of
A possible workaround is to implement a sort of manual pagination, and this might be addressed directly into CHUNK_SIZE = 100
partition_values = ... # list with more than 100 items
counter = 0
items = []
for _ in itertools.count():
_partition_values = partition_values[counter : counter + CHUNK_SIZE]
if _partition_values:
items.extend(
wr.dynamodb.read_items(
table_name=table_name,
partition_values=_partition_values,
)
)
counter += CHUNK_SIZE
else:
break |
I'm using
read_items
but inside that call is another API call. Can this be avoided?aws-sdk-pandas/awswrangler/dynamodb/_read.py
Line 617 in 6c0f65b
To:
aws-sdk-pandas/awswrangler/dynamodb/_utils.py
Line 22 in 6c0f65b
To:
aws-sdk-pandas/awswrangler/dynamodb/_utils.py
Line 42 in 6c0f65b
When I enable debug logging (
boto3.set_stream_logger(name='botocore')
and calltable.key_schema
I see:This means every
read_items
call is doing this extra lookup. Could an option be added to provide thekey_schema
explicitly? Only so many items can be provided toread_items
(100 max) so it's guaranteed that for someone using this library they're going to make this extra call 1% of their requests - if they're doing massive read traffic in the millions this adds up.The text was updated successfully, but these errors were encountered: