amazon-sqs-python-extended-client-lib
amazon-sqs-python-extended-client-lib copied to clipboard
Example code in README doesn't make sense
The example code in the README doesn't make sense as it imports sqs_extended_client and then immediately overwrites that with the return value of boto3.client: https://github.com/awslabs/amazon-sqs-python-extended-client-lib/blob/9175bbd786ca197a4f4df57db52db89f89a65639/README.md#L47-L49
This makes it difficult to understand what's provided by this library and what is from normal boto3.
I agree, this is an ill designed library
Unfortunately this library uses implicit monkey patching, instead of providing simple wrapper or explicit monkey patch apply API. In README example by importing sqs_extended_client module we actually rewrite boto3.Session with SQSExtendedClientSession.
So example should look something like:
import boto3
import sqs_extended_client # noqa: F401, monkeypatch
client = boto3.client("sqs", region_name="us-east-1")
client.large_payload_support = "BUCKET_NAME_HERE"
Or in case you are using resource API:
import boto3
import sqs_extended_client # noqa: F401, monkeypatch
sqs = boto3.resource("sqs")
sqs.meta.client.large_payload_support = "BUCKET_NAME_HERE"