Skip to content

Commit 908c6b6

Browse files
NRL-721 Style changes
1 parent 1938493 commit 908c6b6

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

scripts/delete_all_table_items.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ def delete_all_table_items(table_name):
6161
)
6262

6363
if was_throttled:
64+
scan_kwargs.pop("ExclusiveStartKey", None)
6465
if last_key:
6566
scan_kwargs["ExclusiveStartKey"] = last_key
66-
elif "ExclusiveStartKey" in scan_kwargs:
67-
del scan_kwargs["ExclusiveStartKey"]
6867
continue
6968

7069
if not last_key:

scripts/seed_sandbox_table.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -270,24 +270,25 @@ def _generate_and_write_pointers(
270270
pointer_data: list[list[str]] = []
271271
batch_upsert_items: list[dict[str, Any]] = []
272272

273-
for pointer_type, template in templates.items():
274-
for custodian in CUSTODIANS:
275-
batch_items, csv_rows, counter = _generate_pointers_for_custodian(
276-
template,
277-
pointer_type,
278-
custodian,
279-
pointers_per_type,
280-
counter,
281-
testnum_iter,
282-
)
273+
for (pointer_type, template), custodian in (
274+
(item, cust) for item in templates.items() for cust in CUSTODIANS
275+
):
276+
batch_items, csv_rows, counter = _generate_pointers_for_custodian(
277+
template,
278+
pointer_type,
279+
custodian,
280+
pointers_per_type,
281+
counter,
282+
testnum_iter,
283+
)
283284

284-
pointer_data.extend(csv_rows)
285+
pointer_data.extend(csv_rows)
285286

286-
for item in batch_items:
287-
batch_upsert_items.append(item)
288-
if len(batch_upsert_items) >= 25:
289-
_write_batch_to_dynamodb(table_name, batch_upsert_items)
290-
batch_upsert_items = []
287+
for item in batch_items:
288+
batch_upsert_items.append(item)
289+
if len(batch_upsert_items) >= 25:
290+
_write_batch_to_dynamodb(table_name, batch_upsert_items)
291+
batch_upsert_items = []
291292

292293
_write_batch_to_dynamodb(table_name, batch_upsert_items)
293294

0 commit comments

Comments
 (0)