Skip to content

Update botocore to 1.37.3 #1323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Changes
* patch ``AioEndpoint.__init__()``
* patch ``EventStream._parse_event()``, ``ResponseParser`` and subclasses
* use SPDX license identifier for project metadata
* upstream support for the smithy-rpc-v2-cbor protocol
* bump botocore dependency specification

2.21.1 (2025-03-04)
^^^^^^^^^^^^^^^^^^^
Expand Down
51 changes: 51 additions & 0 deletions aiobotocore/parsers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from botocore.parsers import (
LOG,
BaseCBORParser,
BaseEventStreamParser,
BaseJSONParser,
BaseRestParser,
BaseRpcV2Parser,
BaseXMLResponseParser,
EC2QueryParser,
EventStreamCBORParser,
EventStreamJSONParser,
EventStreamXMLParser,
JSONParser,
Expand All @@ -15,6 +18,7 @@
ResponseParserFactory,
RestJSONParser,
RestXMLParser,
RpcV2CBORParser,
lowercase_dict,
)

Expand Down Expand Up @@ -88,6 +92,10 @@ class AioBaseJSONParser(BaseJSONParser, AioResponseParser):
pass


class AioBaseCBORParser(BaseCBORParser, AioResponseParser):
pass


class AioBaseEventStreamParser(BaseEventStreamParser, AioResponseParser):
pass

Expand All @@ -104,6 +112,12 @@ class AioEventStreamXMLParser(
pass


class AioEventStreamCBORParser(
EventStreamCBORParser, AioBaseEventStreamParser, AioBaseCBORParser
):
pass


class AioJSONParser(JSONParser, AioBaseJSONParser):
EVENT_STREAM_PARSER_CLS = AioEventStreamJSONParser

Expand Down Expand Up @@ -137,10 +151,46 @@ class AioBaseRestParser(BaseRestParser, AioResponseParser):
pass


class AioBaseRpcV2Parser(BaseRpcV2Parser, AioResponseParser):
async def _do_parse(self, response, shape):
parsed = {}
if shape is not None:
event_stream_name = shape.event_stream_name
if event_stream_name:
parsed = await self._handle_event_stream(
response, shape, event_stream_name
)
else:
parsed = {}
self._parse_payload(response, shape, parsed)
parsed['ResponseMetadata'] = self._populate_response_metadata(
response
)
return parsed


class AioRestJSONParser(RestJSONParser, AioBaseRestParser, AioBaseJSONParser):
EVENT_STREAM_PARSER_CLS = AioEventStreamJSONParser


class AioRpcV2CBORParser(
RpcV2CBORParser, AioBaseRpcV2Parser, AioBaseCBORParser
):
EVENT_STREAM_PARSER_CLS = AioEventStreamCBORParser

async def _handle_event_stream(self, response, shape, event_name):
event_stream_shape = shape.members[event_name]
event_stream = self._create_event_stream(response, event_stream_shape)
try:
event = await event_stream.get_initial_response()
except NoInitialResponseError:
error_msg = 'First event was not of type initial-response'
raise ResponseParserError(error_msg)
parsed = self._initial_body_parse(event.payload)
parsed[event_name] = event_stream
return parsed


class AioRestXMLParser(
RestXMLParser, AioBaseRestParser, AioBaseXMLResponseParser
):
Expand All @@ -153,4 +203,5 @@ class AioRestXMLParser(
'json': AioJSONParser,
'rest-json': AioRestJSONParser,
'rest-xml': AioRestXMLParser,
'smithy-rpc-v2-cbor': AioRpcV2CBORParser,
}
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dynamic = ["version", "readme"]
dependencies = [
"aiohttp >= 3.9.2, < 4.0.0",
"aioitertools >= 0.5.1, < 1.0.0",
"botocore >= 1.37.0, < 1.37.2", # NOTE: When updating, always keep `project.optional-dependencies` aligned
"botocore >= 1.37.2, < 1.37.4", # NOTE: When updating, always keep `project.optional-dependencies` aligned
"python-dateutil >= 2.1, < 3.0.0",
"jmespath >= 0.7.1, < 2.0.0",
"multidict >= 6.0.0, < 7.0.0",
Expand All @@ -41,10 +41,10 @@ dependencies = [

[project.optional-dependencies]
awscli = [
"awscli >= 1.38.0, < 1.38.2",
"awscli >= 1.38.2, < 1.38.4",
]
boto3 = [
"boto3 >= 1.37.0, < 1.37.2",
"boto3 >= 1.37.2, < 1.37.4",
]

[project.urls]
Expand Down
Loading