Skip to content

Commit

Permalink
Merge branch 'release-1.21.7'
Browse files Browse the repository at this point in the history
* release-1.21.7:
  Bumping version to 1.21.7
  Add changelog entries from botocore
  Fix f-strings missed by pyupgrade (#3165)
  • Loading branch information
aws-sdk-python-automation committed Feb 24, 2022
2 parents 0095f14 + a523822 commit 33c7bbe
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 111 deletions.
42 changes: 42 additions & 0 deletions .changes/1.21.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"category": "``route53``",
"description": "[``botocore``] SDK doc update for Route 53 to update some parameters with new information.",
"type": "api-change"
},
{
"category": "``databrew``",
"description": "[``botocore``] This AWS Glue Databrew release adds feature to merge job outputs into a max number of files for S3 File output type.",
"type": "api-change"
},
{
"category": "``transfer``",
"description": "[``botocore``] Support automatic pagination when listing AWS Transfer Family resources.",
"type": "api-change"
},
{
"category": "``s3control``",
"description": "[``botocore``] Amazon S3 Batch Operations adds support for new integrity checking capabilities in Amazon S3.",
"type": "api-change"
},
{
"category": "``s3``",
"description": "[``botocore``] This release adds support for new integrity checking capabilities in Amazon S3. You can choose from four supported checksum algorithms for data integrity checking on your upload and download requests. In addition, AWS SDK can automatically calculate a checksum as it streams data into S3",
"type": "api-change"
},
{
"category": "``fms``",
"description": "[``botocore``] AWS Firewall Manager now supports the configuration of AWS Network Firewall policies with either centralized or distributed deployment models. This release also adds support for custom endpoint configuration, where you can choose which Availability Zones to create firewall endpoints in.",
"type": "api-change"
},
{
"category": "``lightsail``",
"description": "[``botocore``] This release adds support to delete and create Lightsail default key pairs that you can use with Lightsail instances.",
"type": "api-change"
},
{
"category": "``autoscaling``",
"description": "[``botocore``] You can now hibernate instances in a warm pool to stop instances without deleting their RAM contents. You can now also return instances to the warm pool on scale in, instead of always terminating capacity that you will need later.",
"type": "api-change"
}
]
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
CHANGELOG
=========

1.21.7
======

* api-change:``route53``: [``botocore``] SDK doc update for Route 53 to update some parameters with new information.
* api-change:``databrew``: [``botocore``] This AWS Glue Databrew release adds feature to merge job outputs into a max number of files for S3 File output type.
* api-change:``transfer``: [``botocore``] Support automatic pagination when listing AWS Transfer Family resources.
* api-change:``s3control``: [``botocore``] Amazon S3 Batch Operations adds support for new integrity checking capabilities in Amazon S3.
* api-change:``s3``: [``botocore``] This release adds support for new integrity checking capabilities in Amazon S3. You can choose from four supported checksum algorithms for data integrity checking on your upload and download requests. In addition, AWS SDK can automatically calculate a checksum as it streams data into S3
* api-change:``fms``: [``botocore``] AWS Firewall Manager now supports the configuration of AWS Network Firewall policies with either centralized or distributed deployment models. This release also adds support for custom endpoint configuration, where you can choose which Availability Zones to create firewall endpoints in.
* api-change:``lightsail``: [``botocore``] This release adds support to delete and create Lightsail default key pairs that you can use with Lightsail instances.
* api-change:``autoscaling``: [``botocore``] You can now hibernate instances in a warm pool to stop instances without deleting their RAM contents. You can now also return instances to the warm pool on scale in, instead of always terminating capacity that you will need later.


1.21.6
======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.21.6'
__version__ = '1.21.7'


# The default Boto3 session; autoloaded when needed.
Expand Down
7 changes: 3 additions & 4 deletions boto3/docs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@ def document_load_reload_action(
It is useful for generating docstrings.
"""
description = (
'Calls :py:meth:`%s.Client.%s` to update the attributes of the'
' %s resource. Note that the load and reload methods are '
'the same method and can be used interchangeably.'
% (
'Calls :py:meth:`{}.Client.{}` to update the attributes of the '
'{} resource. Note that the load and reload methods are '
'the same method and can be used interchangeably.'.format(
get_service_module_name(service_model),
xform_name(load_model.request.operation),
resource_name,
Expand Down
7 changes: 3 additions & 4 deletions boto3/docs/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ def document_identifier(
description = get_identifier_description(
resource_name, identifier_model.name
)
description = '*(string)* ' + description
section.write(description)
section.write(f'*(string)* {description}')


def document_reference(section, reference_model, include_signature=True):
if include_signature:
section.style.start_sphinx_py_attr(reference_model.name)
reference_type = '(:py:class:`%s`) ' % reference_model.resource.type
reference_type = f'(:py:class:`{reference_model.resource.type}`) '
section.write(reference_type)
section.include_doc_string(
'The related %s if set, otherwise ``None``.' % reference_model.name
f'The related {reference_model.name} if set, otherwise ``None``.'
)
42 changes: 18 additions & 24 deletions boto3/docs/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ def document_collection_object(
if include_signature:
section.style.start_sphinx_py_attr(collection_model.name)
section.include_doc_string(
'A collection of %s resources.' % collection_model.resource.type
f'A collection of {collection_model.resource.type} resources.'
)
section.include_doc_string(
'A %s Collection will include all resources by default, '
'and extreme caution should be taken when performing '
'actions on all resources.' % collection_model.resource.type
f'A {collection_model.resource.type} Collection will include all '
f'resources by default, and extreme caution should be taken when '
f'performing actions on all resources.'
)


Expand Down Expand Up @@ -200,8 +200,8 @@ def document_collection_method(
custom_action_info_dict = {
'all': {
'method_description': (
'Creates an iterable of all %s resources '
'in the collection.' % collection_model.resource.type
f'Creates an iterable of all {collection_model.resource.type} '
f'resources in the collection.'
),
'example_prefix': '{}_iterator = {}.{}.all'.format(
xform_name(collection_model.resource.type),
Expand All @@ -212,16 +212,12 @@ def document_collection_method(
},
'filter': {
'method_description': (
'Creates an iterable of all %s resources '
'in the collection filtered by kwargs passed to '
'method. A %s collection will include all resources by '
'default if no filters are provided, and extreme '
'caution should be taken when performing actions '
'on all resources.'
% (
collection_model.resource.type,
collection_model.resource.type,
)
f'Creates an iterable of all {collection_model.resource.type} '
f'resources in the collection filtered by kwargs passed to '
f'method. A {collection_model.resource.type} collection will '
f'include all resources by default if no filters are provided, '
f'and extreme caution should be taken when performing actions '
f'on all resources.'
),
'example_prefix': '{}_iterator = {}.{}.filter'.format(
xform_name(collection_model.resource.type),
Expand All @@ -234,9 +230,8 @@ def document_collection_method(
},
'limit': {
'method_description': (
'Creates an iterable up to a specified amount of '
'%s resources in the collection.'
% collection_model.resource.type
f'Creates an iterable up to a specified amount of '
f'{collection_model.resource.type} resources in the collection.'
),
'example_prefix': '{}_iterator = {}.{}.limit'.format(
xform_name(collection_model.resource.type),
Expand All @@ -257,10 +252,9 @@ def document_collection_method(
},
'page_size': {
'method_description': (
'Creates an iterable of all %s resources '
'in the collection, but limits the number of '
'items returned by each service call by the specified '
'amount.' % collection_model.resource.type
f'Creates an iterable of all {collection_model.resource.type} '
f'resources in the collection, but limits the number of '
f'items returned by each service call by the specified amount.'
),
'example_prefix': '{}_iterator = {}.{}.page_size'.format(
xform_name(collection_model.resource.type),
Expand Down Expand Up @@ -288,5 +282,5 @@ def document_collection_method(
event_emitter=event_emitter,
resource_action_model=collection_model,
include_signature=include_signature,
**action_info
**action_info,
)
12 changes: 6 additions & 6 deletions boto3/docs/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ def document_model_driven_resource_method(
operation_model.service_model.service_name, resource_type
)

return_type = ':py:class:`%s`' % return_resource_type
return_description = '%s resource' % (resource_type)
return_type = f':py:class:`{return_resource_type}`'
return_description = f'{resource_type} resource'

if _method_returns_resource_list(resource_action_model.resource):
return_type = 'list(%s)' % return_type
return_description = 'A list of %s resources' % (resource_type)
return_type = f'list({return_type})'
return_description = f'A list of {resource_type} resources'

new_return_section.style.new_line()
new_return_section.write(':rtype: %s' % return_type)
new_return_section.write(f':rtype: {return_type}')
new_return_section.style.new_line()
new_return_section.write(':returns: %s' % return_description)
new_return_section.write(f':returns: {return_description}')
new_return_section.style.new_line()


Expand Down
25 changes: 11 additions & 14 deletions boto3/docs/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _add_params_description(self, section, identifier_names):
description = get_identifier_description(
self._resource_name, identifier_name
)
section.write(':type %s: string' % identifier_name)
section.write(f':type {identifier_name}: string')
section.style.new_line()
section.write(f':param {identifier_name}: {description}')
section.style.new_line()
Expand All @@ -122,20 +122,19 @@ def _add_overview_of_members(self, section):
for resource_member_type in self.member_map:
section.style.new_line()
section.write(
'These are the resource\'s available %s:'
% (resource_member_type)
f'These are the resource\'s available {resource_member_type}:'
)
section.style.new_line()
for member in self.member_map[resource_member_type]:
if resource_member_type in [
'identifiers',
if resource_member_type in (
'attributes',
'references',
'collections',
]:
section.style.li(':py:attr:`%s`' % member)
'identifiers',
'references',
):
section.style.li(f':py:attr:`{member}`')
else:
section.style.li(':py:meth:`%s()`' % member)
section.style.li(f':py:meth:`{member}()`')

def _add_identifiers(self, section):
identifiers = self._resource.meta.resource_model.identifiers
Expand Down Expand Up @@ -262,14 +261,14 @@ def _add_waiters(self, section):
class ServiceResourceDocumenter(ResourceDocumenter):
@property
def class_name(self):
return '%s.ServiceResource' % self._service_docs_name
return f'{self._service_docs_name}.ServiceResource'

def _add_title(self, section):
section.style.h2('Service Resource')

def _add_description(self, section):
official_service_name = get_official_service_name(self._service_model)
section.write('A resource representing %s' % official_service_name)
section.write(f'A resource representing {official_service_name}')

def _add_example(self, section, identifier_names):
section.style.start_codeblock()
Expand All @@ -278,8 +277,6 @@ def _add_example(self, section, identifier_names):
section.style.new_line()
section.style.new_line()
section.write(
'{} = boto3.resource(\'{}\')'.format(
self._service_name, self._service_name
)
f'{self._service_name} = boto3.resource(\'{self._service_name}\')'
)
section.style.end_codeblock()
6 changes: 3 additions & 3 deletions boto3/docs/subresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def document_sub_resource(
)

method_intro_section = section.add_new_section('method-intro')
description = 'Creates a %s resource.' % sub_resource_model.resource.type
description = f'Creates a {sub_resource_model.resource.type} resource.'
method_intro_section.include_doc_string(description)
example_section = section.add_new_section('example')
example_values = get_identifier_values_for_example(identifiers_needed)
Expand All @@ -105,7 +105,7 @@ def document_sub_resource(
description = get_identifier_description(
sub_resource_model.name, identifier
)
param_section.write(':type %s: string' % identifier)
param_section.write(f':type {identifier}: string')
param_section.style.new_line()
param_section.write(f':param {identifier}: {description}')
param_section.style.new_line()
Expand All @@ -120,6 +120,6 @@ def document_sub_resource(
)
return_section.style.new_line()
return_section.write(
':returns: A %s resource' % sub_resource_model.resource.type
f':returns: A {sub_resource_model.resource.type} resource'
)
return_section.style.new_line()
30 changes: 15 additions & 15 deletions boto3/docs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ def get_resource_public_actions(resource_class):


def get_identifier_values_for_example(identifier_names):
example_values = ['\'%s\'' % identifier for identifier in identifier_names]
return ','.join(example_values)
return ','.join([f'\'{identifier}\'' for identifier in identifier_names])


def get_identifier_args_for_signature(identifier_names):
return ','.join(identifier_names)


def get_identifier_description(resource_name, identifier_name):
return "The {}'s {} identifier. This **must** be set.".format(
resource_name, identifier_name
return (
f"The {resource_name}'s {identifier_name} identifier. "
f"This **must** be set."
)


Expand All @@ -81,9 +81,8 @@ def add_resource_type_overview(
section.style.new_line()
if intro_link is not None:
section.write(
'For more information about %s refer to the '
':ref:`Resources Introduction Guide<%s>`.'
% (resource_type.lower(), intro_link)
f'For more information about {resource_type.lower()} refer to the '
f':ref:`Resources Introduction Guide<{intro_link}>`.'
)
section.style.new_line()

Expand Down Expand Up @@ -122,16 +121,17 @@ def _replace_documentation(self, event_name, section):
if event_name.startswith(
'docs.request-params'
) or event_name.startswith('docs.response-params'):
allowed_sections = (
'param-name',
'param-documentation',
'end-structure',
'param-type',
'end-param',
)
for section_name in section.available_sections:
# Delete any extra members as a new shape is being
# used.
if section_name not in [
'param-name',
'param-documentation',
'end-structure',
'param-type',
'end-param',
]:
if section_name not in allowed_sections:
section.delete_section(section_name)

# Update the documentation
Expand All @@ -146,4 +146,4 @@ def _replace_documentation(self, event_name, section):
type_section.write(f':type {section.name}: {self._new_type}')
else:
type_section.clear_text()
type_section.style.italics('(%s) -- ' % self._new_type)
type_section.style.italics(f'({self._new_type}) -- ')
9 changes: 4 additions & 5 deletions boto3/docs/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ def document_resource_waiter(
ignore_params = get_resource_ignore_params(resource_waiter_model.params)
service_module_name = get_service_module_name(service_model)
description = (
'Waits until this %s is %s. This method calls '
':py:meth:`%s.Waiter.%s.wait` which polls. '
':py:meth:`%s.Client.%s` every %s seconds until '
'Waits until this {} is {}. This method calls '
':py:meth:`{}.Waiter.{}.wait` which polls. '
':py:meth:`{}.Client.{}` every {} seconds until '
'a successful state is reached. An error is returned '
'after %s failed checks.'
% (
'after {} failed checks.'.format(
resource_name,
' '.join(resource_waiter_model.name.split('_')[2:]),
service_module_name,
Expand Down
6 changes: 3 additions & 3 deletions boto3/dynamodb/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ def _build_expression_component(
elif isinstance(value, AttributeBase):
if is_key_condition and not isinstance(value, Key):
raise DynamoDBNeedsKeyConditionError(
'Attribute object %s is of type %s. '
'KeyConditionExpression only supports Attribute objects '
'of type Key' % (value.name, type(value))
f'Attribute object {value.name} is of type {type(value)}. '
f'KeyConditionExpression only supports Attribute objects '
f'of type Key'
)
return self._build_name_placeholder(
value, attribute_name_placeholders
Expand Down

0 comments on commit 33c7bbe

Please sign in to comment.