aws-samples / aws-samples/amazon-textract-code-samples

Bug with Detecting Merged Cells And Headers on fictitious bank statement

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
449
Forks
262
PR merge metrics
No merged PRs in 30d

Description

When running the notebook https://github.com/aws-samples/amazon-textract-code-samples/blob/master/python/Textract-Table-Merged-Cells-And-Headers.ipynb you get following error

`Traceback (most recent call last):

File "/opt/conda/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 5, in
from textractprettyprinter.t_pretty_print import Pretty_Print_Table_Format, Textract_Pretty_Print, get_string, get_tables_string

File "/opt/conda/lib/python3.7/site-packages/textractprettyprinter/__init__.py", line 3, in
from .t_pretty_print import Pretty_Print_Table_Format as Pretty_Print_Table_Format

File "/opt/conda/lib/python3.7/site-packages/textractprettyprinter/t_pretty_print.py", line 1, in
import trp

File "/opt/conda/lib/python3.7/site-packages/trp/__init__.py", line 31
print ip
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(ip)?`

This is fixed by adding
`!pip install textract-trp`

Once that is fixed you get following error

`AttributeError: 'Table' object has no attribute 'get_header_field_names'`

Contributor guide

Open the contributing guide

Research direction

Start by running Textract-Table-Merged-Cells-And-Headers.ipynb and inspect its imports of textractprettyprinter and trp. Check the package compatibility behind the Python 3.7 SyntaxError and the missing Table.get_header_field_names method; done means the notebook completes merged-cell and header detection without either error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, jupyter-notebook, python
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.