Skip to content

Commit 6c47a7d

Browse files
committed
Fix ValueError when processing tables with empty cells
1 parent 681673f commit 6c47a7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pymupdf4llm/pymupdf4llm/helpers/pymupdf_rag.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,10 @@ def get_page_output(
10521052
else:
10531053
tabs = page.find_tables(clip=parms.clip, strategy=table_strategy)
10541054
for t in tabs.tables:
1055+
# Skip tables with no valid cells (would cause bbox calculation to fail)
1056+
if not any(c is not None for c in t.cells):
1057+
continue
1058+
10551059
# remove tables with too few rows or columns
10561060
if t.row_count < 2 or t.col_count < 2:
10571061
omitted_table_rects.append(pymupdf.Rect(t.bbox))

0 commit comments

Comments
 (0)