The _merge_tables_with_empty_tables function in html.py is not properly used in any of the test cases.
It is only ever called in the case that there are empty_tables in the files being analysed. There are a handful of files that have this, however, they also have no tables["documents"] and therefore the loop has no seen_ids to iterate over.
The loop in question (note that if documents is empty, then so too is seen_ids):
seen_ids: dict[int, str] = {}
for i, table in enumerate(documents):
if "id" in table:
seen_ids[i] = f"Table {table['id']}."
for table in empty_tables:
for seen_id in seen_ids:
# Never do stuff
The
_merge_tables_with_empty_tablesfunction inhtml.pyis not properly used in any of the test cases.It is only ever called in the case that there are
empty_tablesin the files being analysed. There are a handful of files that have this, however, they also have notables["documents"]and therefore the loop has noseen_idsto iterate over.The loop in question (note that if
documentsis empty, then so too isseen_ids):