Skip to content

Commit

Permalink
Bump aiobotocore to 2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
terricain committed Jun 25, 2024
1 parent 6b7bf35 commit 6682647
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 397 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
History
=======

13.1.0 (2024-06-25)
-------------------

* Bumped aiobotocore to 2.13.1

13.0.1 (2024-06-05)
-------------------

Expand Down
51 changes: 30 additions & 21 deletions aioboto3/resources/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async def pages(self):
cleaned_params = self._params.copy()
limit = cleaned_params.pop('limit', None)
page_size = cleaned_params.pop('page_size', None)
params = create_request_parameters(
self._parent, self._model.request)
params = create_request_parameters(self._parent, self._model.request)
merge_dicts(params, cleaned_params, append_lists=True)

# Is this a paginated operation? If so, we need to get an
Expand All @@ -51,20 +50,27 @@ async def pages(self):
# page in a list. For non-paginated results, we just ignore
# the page size parameter.
if client.can_paginate(self._py_operation_name):
logger.debug('Calling paginated %s:%s with %r',
self._parent.meta.service_name,
self._py_operation_name, params)
logger.debug(
'Calling paginated %s:%s with %r',
self._parent.meta.service_name,
self._py_operation_name,
params
)
paginator = client.get_paginator(self._py_operation_name)
pages = paginator.paginate(
PaginationConfig={
'MaxItems': limit, 'PageSize': page_size}, **params)
PaginationConfig={'MaxItems': limit, 'PageSize': page_size},
**params
)
else:
async def _aiopaginatordummy():
yield await getattr(client, self._py_operation_name)(**params)

logger.debug('Calling %s:%s with %r',
self._parent.meta.service_name,
self._py_operation_name, params)
logger.debug(
'Calling %s:%s with %r',
self._parent.meta.service_name,
self._py_operation_name,
params
)
pages = _aiopaginatordummy()

# Now that we have a page iterator or single page of results
Expand Down Expand Up @@ -107,8 +113,9 @@ def __init__(self, collection_model, parent, factory, service_context):


class AIOCollectionFactory(CollectionFactory):
def load_from_definition(self, resource_name, collection_model,
service_context, event_emitter):
def load_from_definition(
self, resource_name, collection_model, service_context, event_emitter
):
attrs = {}
collection_name = collection_model.name

Expand All @@ -118,25 +125,26 @@ def load_from_definition(self, resource_name, collection_model,
resource_name,
collection_model,
service_context.service_model,
event_emitter)
event_emitter
)
# Add the documentation to the collection class's methods
self._load_documented_collection_methods(
attrs=attrs,
resource_name=resource_name,
collection_model=collection_model,
service_model=service_context.service_model,
event_emitter=event_emitter,
base_class=AIOResourceCollection)
base_class=AIOResourceCollection
)

if service_context.service_name == resource_name:
cls_name = '{0}.{1}Collection'.format(
service_context.service_name, collection_name)
cls_name = (
f'{service_context.service_name}.{collection_name}Collection'
)
else:
cls_name = '{0}.{1}.{2}Collection'.format(
service_context.service_name, resource_name, collection_name)
cls_name = f'{service_context.service_name}.{resource_name}.{collection_name}Collection'

collection_cls = type(str(cls_name), (AIOResourceCollection,),
attrs)
collection_cls = type(str(cls_name), (AIOResourceCollection,), attrs)

# Add the documentation to the collection manager's methods
self._load_documented_collection_methods(
Expand All @@ -145,7 +153,8 @@ def load_from_definition(self, resource_name, collection_model,
collection_model=collection_model,
service_model=service_context.service_model,
event_emitter=event_emitter,
base_class=AIOCollectionManager)
base_class=AIOCollectionManager
)
attrs['_collection_cls'] = collection_cls
cls_name += 'Manager'

Expand Down
6 changes: 3 additions & 3 deletions aioboto3/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def __init__(

# Setup custom user-agent string if it isn't already customized
if self._session.user_agent_name == 'Botocore':
botocore_info = 'Botocore/{0}'.format(
self._session.user_agent_version)
botocore_info = f'Botocore/{self._session.user_agent_version}'
if self._session.user_agent_extra:
self._session.user_agent_extra += ' ' + botocore_info
else:
Expand All @@ -69,7 +68,8 @@ def __init__(

if aws_access_key_id or aws_secret_access_key or aws_session_token:
self._session.set_credentials(
aws_access_key_id, aws_secret_access_key, aws_session_token)
aws_access_key_id, aws_secret_access_key, aws_session_token
)

if region_name is not None:
self._session.set_config_variable('region', region_name)
Expand Down
Loading

0 comments on commit 6682647

Please sign in to comment.