Skip to content

Commit

Permalink
Ensure cell block has text element
Browse files Browse the repository at this point in the history
  • Loading branch information
Belval authored May 6, 2024
2 parents 54aeaca + 8d5d817 commit 44a002d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _dfs(self, root, id2block):
for cell_id in cell_rel['Ids']:
cell_block = id2block[cell_id]
if "Relationships" in cell_block:
cell_text = " ".join([id2block[line_id]['Text'] for line_id in cell_block["Relationships"][0]['Ids']])
cell_text = " ".join([id2block[line_id]['Text'] for line_id in cell_block["Relationships"][0]['Ids'] if 'Text' in id2block[line_id]])
row_idx = cell_block['RowIndex']
col_idx = cell_block['ColumnIndex']
max_row = max(max_row, row_idx)
Expand Down

0 comments on commit 44a002d

Please sign in to comment.