aws-samples / amazon-textract-response-parser

Parse JSON response of Amazon Textract
Apache License 2.0
218 stars 95 forks source link

Fails when no Geometry exists #146

Closed schadem closed 1 year ago

schadem commented 1 year ago

a QUERY_RESULT could have not geometry:

        {
            "BlockType": "QUERY_RESULT",
            "Confidence": 98.0,
            "Text": "Ana Carolina",
            "Id": "5c860e58-deb4-4c24-8282-2394a2c535c0"
        }
    ],

current implementation for create_geometry_from_blocks fails with

all_points = [p.geometry.bounding_box.points for p in values] E AttributeError: 'NoneType' object has no attribute 'bounding_box'