Skip to content

Commit 9f3e45b

Browse files
committed
Merge branch 'm-kovalsky/786'
2 parents d9c7460 + 87f8538 commit 9f3e45b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/sempy_labs/lakehouse/_lakehouse.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,15 @@ def optimize_lakehouse_tables(
100100
tables = [tables]
101101

102102
df_tables = df_delta[df_delta["Table Name"].isin(tables)] if tables else df_delta
103+
df_tables.reset_index(drop=True, inplace=True)
103104

104-
for _, r in (bar := tqdm(df_tables.iterrows())):
105+
total = len(df_tables)
106+
for idx, r in (bar := tqdm(df_tables.iterrows(), total=total, bar_format="{desc}")):
105107
table_name = r["Table Name"]
106108
path = r["Location"]
107-
bar.set_description(f"Optimizing the '{table_name}' table...")
109+
bar.set_description(
110+
f"Optimizing the '{table_name}' table ({idx + 1}/{total})..."
111+
)
108112
_optimize_table(path=path)
109113

110114

@@ -145,11 +149,13 @@ def vacuum_lakehouse_tables(
145149
tables = [tables]
146150

147151
df_tables = df_delta[df_delta["Table Name"].isin(tables)] if tables else df_delta
152+
df_tables.reset_index(drop=True, inplace=True)
148153

149-
for _, r in (bar := tqdm(df_tables.iterrows())):
154+
total = len(df_tables)
155+
for idx, r in (bar := tqdm(df_tables.iterrows(), total=total, bar_format="{desc}")):
150156
table_name = r["Table Name"]
151157
path = r["Location"]
152-
bar.set_description(f"Vacuuming the '{table_name}' table...")
158+
bar.set_description(f"Vacuuming the '{table_name}' table ({idx}/{total})...")
153159
_vacuum_table(path=path, retain_n_hours=retain_n_hours)
154160

155161

0 commit comments

Comments
 (0)