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
In one of my input pdf files, the following is thrown:
File "/home/michaelt/Work/sandbox_gradio/inference/lib/python3.12/site-packages/unstructured_inference/models/tables.py", line 667, in fill_cells
table_rows_no = max({row for cell in cells for row in cell["row_nums"]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: max() iterable argument is empty
Debugging shows that cells array is, indeed, [].
Proposed fix:
table_rows_no = max({row for cell in cells for row in cell["row_nums"]}, default=0)
table_cols_no = max({col for cell in cells for col in cell["column_nums"]}, default=0)
It fixed my problem.
The text was updated successfully, but these errors were encountered:
This PR will address
#357 and
#358.
### Summary
- add logic to validate the input parameter to the fill_cells()
function. Now, the function checks if the input is a list of
dictionaries before processing.
- correct type hint for parameter `cells` in
`table_cells_to_dataframe()`
In one of my input pdf files, the following is thrown:
File "/home/michaelt/Work/sandbox_gradio/inference/lib/python3.12/site-packages/unstructured_inference/models/tables.py", line 667, in fill_cells
table_rows_no = max({row for cell in cells for row in cell["row_nums"]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: max() iterable argument is empty
Debugging shows that cells array is, indeed, [].
Proposed fix:
It fixed my problem.
The text was updated successfully, but these errors were encountered: