You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When there is an empty table in a pdf document, if layout model is used, extract_pdf_content will fail with "list index out of range" error.
Expected behavior
Empty table should be skipped.
Code fix needed
Add try catch and skip the empty table.
for table in form_recognizer_results.tables:
try:
table.spans[0]
except:
continue
table_offset = table.spans[0].offset
table_length = table.spans[0].length
if page_offset <= table_offset and table_offset + table_length < page_offset + page_length:
tables_on_page.append(table)
The text was updated successfully, but these errors were encountered:
Describe the bug
When there is an empty table in a pdf document, if layout model is used, extract_pdf_content will fail with "list index out of range" error.
Expected behavior
Empty table should be skipped.
Code fix needed
Add try catch and skip the empty table.
for table in form_recognizer_results.tables:
try:
table.spans[0]
except:
continue
table_offset = table.spans[0].offset
table_length = table.spans[0].length
if page_offset <= table_offset and table_offset + table_length < page_offset + page_length:
tables_on_page.append(table)
The text was updated successfully, but these errors were encountered: