-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
The ReceiveMessageResultTypeDef
specifies the "Messages" key as required, but the Boto3 SQS client does not provide a value for that when no messages are received.
If no messages are available and the wait time expires, the call does not return a message list (WaitTimeSeconds parameter for ReceiveMessages)
Side note: the documentation was previously corrected after a discussion in boto/boto3#2518 about this.
Runtime example
Attempt to receive messages from a queue which has no messages available
sqs_client = boto3.client("sqs")
response = sqs_client.receive_message(QueueUrl="...")
response.keys()
The response contains only "ResponseMetadata", no entry for "Messages"
{
"ResponseMetadata": {
"RequestId": "...",
"HTTPStatusCode": 200,
...
}
}
Current stub
class ReceiveMessageResultTypeDef(TypedDict):
Messages: list[MessageTypeDef]
ResponseMetadata: ResponseMetadataTypeDef
Expected stub
class ReceiveMessageResultTypeDef(TypedDict):
Messages: NotRequired[list[MessageTypeDef]]
ResponseMetadata: ResponseMetadataTypeDef
Additional context
Ran using Boto3 version 1.38.45 on Python 3.13.1
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working