-
Notifications
You must be signed in to change notification settings - Fork 719
Open
Labels
Description
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
| table_key_schema = get_table(table_name=table_name, boto3_session=boto3_session).key_schema |
To:
| def get_table( |
To:
| dynamodb_table = dynamodb_resource.Table(table_name) |
When I enable debug logging (boto3.set_stream_logger(name='botocore') and call table.key_schema I see:
2023-07-18 09:19:42,633 botocore.hooks [DEBUG] Event request-created.dynamodb.DescribeTable: calling handler <function add_retry_headers at 0x1a316ec20>
This means every read_items call is doing this extra lookup. Could an option be added to provide the key_schema explicitly? Only so many items can be provided to read_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.