Skip to content

Commit 8f576a3

Browse files
committed
Debug depth error
1 parent 998c05b commit 8f576a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mariadb_pdf/setup/kb_urls.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@ def read_csv(num_rows: int, port: int) -> list[CsvItem]:
6060

6161
def apply_depth(kb_urls: list[CsvItem]) -> list[CsvItem]:
6262
depths = []
63-
for row in kb_urls:
63+
for line, row in enumerate(kb_urls):
6464
if row.depth >= len(depths):
6565
depths.extend([0] * (row.depth-len(depths)))
6666
elif row.depth < len(depths):
6767
for _ in range(len(depths)-row.depth):
6868
depths.pop()
69+
if len(depths) == 0:
70+
print("error: invalid depth on line: ", line + 1)
71+
exit(0)
72+
6973
depths[row.depth-1] += 1
7074
row.depth_str = '.'.join([str(num) for num in depths])
7175
while row.depth_str.startswith("0."):

0 commit comments

Comments
 (0)