sqs get_queue_attributes() has the wrong type for AttributeNames
See original GitHub issueDescribe the bug
The boto3 documentation clearly state that AttributeNames has over 20 valid values, but mypy_boto3 is giving it the QueueAttributeFilterType literals which only has 10 different values.
To Reproduce Steps to reproduce the behavior:
- Install
boto3-stubs[sqs] - Run
mypy/pyrighton the following code sample
import boto3
import mypy_boto3_sqs
sqs_client: mypy_boto3_sqs.Client = boto3.client('sqs')
sqs_client.get_queue_attributes(QueueUrl='anything', AttributeNames=('LastModifiedTimestamp',))
Argument “AttributeNames” to “get_queue_attributes” of “SQSClient” has incompatible type “Tuple[str]”; expected “Sequence[Literal[‘AWSTraceHeader’, ‘All’, ‘ApproximateFirstReceiveTimestamp’, ‘ApproximateReceiveCount’, ‘MessageDeduplicationId’, ‘MessageGroupId’, ‘SenderId’, ‘SentTimestamp’, ‘SequenceNumber’, ‘SqsManagedSseEnabled’]]” [arg-type] (7:41)
In mypy_boto3_sqs.client.pyi:
```python
def get_queue_attributes(
self, *, QueueUrl: str, AttributeNames: Sequence[QueueAttributeFilterType] = ...
) -> GetQueueAttributesResultTypeDef:
should be:
def get_queue_attributes(
self, *, QueueUrl: str, AttributeNames: Sequence[QueueAttributeNameType] = ...
) -> GetQueueAttributesResultTypeDef:
Additional context macOS 12.5.1, Python 3.10.6.
pip install boto3==1.24.59 'boto3-stubs[sqs]==1.24.59'
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
GetQueueAttributes - Amazon Simple Queue Service
The URL of the Amazon SQS queue whose attribute information is retrieved. Queue URLs and names are case-sensitive. Type: String. Required: Yes. Response ......
Read more >SQS.ReceiveMessage has the wrong list of valid values for ...
A list of attributes that need to be returned along with each message. These attributes include: All – Returns all values.
Read more >Retrieve multiple messages from SQS - java - Stack Overflow
So my code is like: ReceiveMessageRequest receive_request = new ReceiveMessageRequest() .withQueueUrl(QUEUE_URL) .withWaitTimeSeconds(20) .
Read more >Working with Amazon SQS in Python using Boto3
In the above example, we set DelaySeconds and MaximumMessageSize attributes for the queue. The set_queue_attributes() method does not return any ...
Read more >3 surprising facts about AWS SQS FIFO queues - Tom Gregory
The first-in-first-out (FIFO) queue is the type of AWS SQS queue that ... QUEUE_SIZE=$(aws sqs get-queue-attributes --attribute-names ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@vemel it worked for me. Thanks for the quick turnaround!
Fixed in
mypy-boto3-sqs1.24.60.Please check and let me know if it works as it should.