Skip to content

Commit 17140a5

Browse files
committed
name the constant, no magic numbers
1 parent ec44d0d commit 17140a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/python/feast/infra/utils/aws_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,11 +1086,16 @@ class DynamoUnprocessedWriteItems(Exception):
10861086

10871087

10881088
async def dynamo_write_items(dynamo_client, table_name: str, items: list[Any]) -> None:
1089+
DYNAMO_MAX_WRITE_BATCH_SIZE = 25
1090+
10891091
async def _do_write(items):
10901092
item_iter = iter(items)
10911093
item_batches = []
10921094
while True:
1093-
item_batch = [item for item in itertools.islice(item_iter, 25)]
1095+
item_batch = [
1096+
item
1097+
for item in itertools.islice(item_iter, DYNAMO_MAX_WRITE_BATCH_SIZE)
1098+
]
10941099
if not item_batch:
10951100
break
10961101

0 commit comments

Comments
 (0)