boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
9.04k stars 1.87k forks source link

dynamodb - Expose flush_amount for batch_writer() #2188

Open darwinyip opened 5 years ago

darwinyip commented 5 years ago

Currently the batch_writer() does not take flush_amount even though BatchWriter does. It would be great if this could be exposed for increased configurability.

swetashre commented 4 years ago

@darwinyip - Thank you for your post. I would mark this as enhancement. But in the mean time you could use BatchWriter if you want to use flush_amount. Something like this:

import boto3
from boto3.dynamodb.table import BatchWriter

with BatchWriter('mytable', dynamodb.meta.client, flush_amount= 10) as batch:
    for i in range(10):
        batch.put_item(Item={'test': 'testing_{}'.format(i)})

Hope it helps

github-actions[bot] commented 3 years ago

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.