Amazon Textract boto3 response changed when using in lambda


Our application is looking for response from textract to be in a certain format all the time.

Wanted to know how to call textract from lambda(python) by giving a specific version ? Our script is always calling the latest version of textract.

Can you please point me to code snippet or an example on how we could call by giving version number ?


asked 8 months ago92 views
2 Answers

Hi, thank you for using Textract. Textract did update the table model to support merged_cells and table_headers.

The update adds a new BlockType called "MERGED_CELLS" and Relationships Type "MERGED_CELL" and an EntityType "COLUMN_HEADER". If you don't need those, you can ignore them.

Outside of those additions the response is the same as the "older" one with all CELLs of a TABLE being the CHILD Relationship. See:

I recommend using for parsing the response in Python.

answered 8 months ago

There is no difference in response format when calling Textract from Lambda vs. locally or from an EC2 instance. BUT Lambda does not always include the latest SDK version.

Check for more information. You may have to install the same boto3 version (here is an example:

I usually use containers with Lambda now (generated with SAM or CDK) where I have full control.

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions