Skip to content

Commit

Permalink
name the constant, no magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
robhowley committed Oct 23, 2024
1 parent ec44d0d commit 17140a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/python/feast/infra/utils/aws_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,11 +1086,16 @@ class DynamoUnprocessedWriteItems(Exception):


async def dynamo_write_items(dynamo_client, table_name: str, items: list[Any]) -> None:
DYNAMO_MAX_WRITE_BATCH_SIZE = 25

async def _do_write(items):
item_iter = iter(items)
item_batches = []
while True:
item_batch = [item for item in itertools.islice(item_iter, 25)]
item_batch = [
item
for item in itertools.islice(item_iter, DYNAMO_MAX_WRITE_BATCH_SIZE)
]
if not item_batch:
break

Expand Down

0 comments on commit 17140a5

Please sign in to comment.