Skip to content

Commit 4d858d6

Browse files
committed
add tqdm
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 3993023 commit 4d858d6

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

infra/scripts/cleanup_dynamo_ci.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import boto3
2+
from tqdm import tqdm
23

34

45
def main() -> None:
56
db = boto3.resource("dynamodb")
67

7-
num_deleted = 0
8-
for table in db.tables.all():
8+
num_to_delete = 0
9+
all_tables = db.tables.all()
10+
for table in all_tables:
911
if "integration_test" in table.name:
10-
table.delete()
11-
num_deleted += 1
12-
print(f"Deleted {num_deleted} CI DynamoDB tables")
12+
num_to_delete += 1
13+
with tqdm(total=num_to_delete) as progress:
14+
for table in all_tables:
15+
if "integration_test" in table.name:
16+
table.delete()
17+
progress.update()
18+
print(f"Deleted {num_to_delete} CI DynamoDB tables")
1319

1420

1521
if __name__ == "__main__":

0 commit comments

Comments
 (0)