Not recognizing Queries service of Textract

0

I have an issue with not recognizing the Query service of Textract on AWS. The image is built and deployed with the SAM framework, it's interesting that without using SAM the Query service works in the pure local docker container. The Forms service of Textract works in both scenarios.

These are the versions of libraries that I used: Base image public.ecr.aws/lambda/python:3.9 with the following version of SDK: boto3: 1.24.35 botocore: 1.27.35

This is the error: "Unknown parameter in input: "QueriesConfig", must be one of: Document, FeatureTypes, HumanLoopConfig"

Also, there are 2 similar questions here on the forum from 2 months ago that point to a similar issue that is still not resolved. Can you help us with this issue? Thank you!

  • Just to clarify, did you already check at the point of use (e.g. print(botocore.__version__))? According to the boto3 and botocore changelogs, this feature should be supported... So my guess is your upgraded boto3 installation is being shadowed by the runtime default boto3==1.20.32. In SAM, are you upgrading your function's boto3 via requirements.txt? are you building with --use-container?

  • @Alex_T, It seems that you are right about the default runtime, the print function shows: Botocore: 1.23.32 and Boto3: 1.20.32. Do you know how I can change priority or default runtime for AWS SDK ? Thanks. Btw, I'm using Poetry for dependency management and sam build --use-container as building command.

1 Answer
0

Hi, could you verify your boto installation version within your installed Python? It is probably related to an old version of boto hence does not support Query. If there are mulitple versions of boto installation, you can also check and update your PYTHONPATH to point to the right version. Thanks.

AWS
answered 2 years ago
  • The print function shows Botocore: 1.23.32 and Boto3: 1.20.32. How should I find the right python path for the appropriate botocore ? Interactive container? Thanks.

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