Skip to content

Commit

Permalink
Merge branch 'release-1.34.24'
Browse files Browse the repository at this point in the history
* release-1.34.24:
  Bumping version to 1.34.24
  Update changelog based on model updates
  Add warning for non-positive max-items value (#8931)
  • Loading branch information
aws-sdk-python-automation committed Sep 20, 2024
2 parents 845d103 + 6b5200b commit 51dc74f
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .changes/1.34.24.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"category": "``dynamodb``",
"description": "Generate account endpoint for DynamoDB requests when the account ID is available",
"type": "api-change"
},
{
"category": "``neptune``",
"description": "Add v2 smoke tests and smithy smokeTests trait for SDK testing.",
"type": "api-change"
},
{
"category": "``sagemaker``",
"description": "Amazon SageMaker now supports using manifest files to specify the location of uncompressed model artifacts within Model Packages",
"type": "api-change"
},
{
"category": "``sagemaker-metrics``",
"description": "This release introduces support for the SageMaker Metrics BatchGetMetrics API.",
"type": "api-change"
},
{
"category": "``workspaces``",
"description": "Releasing new ErrorCodes for SysPrep failures during ImageImport and CreateImage process",
"type": "api-change"
},
{
"category": "paginator",
"description": "Add warning when a non-positive value is provided for the max-items pagination parameter.",
"type": "enhancement"
}
]
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
CHANGELOG
=========

1.34.24
=======

* api-change:``dynamodb``: Generate account endpoint for DynamoDB requests when the account ID is available
* api-change:``neptune``: Add v2 smoke tests and smithy smokeTests trait for SDK testing.
* api-change:``sagemaker``: Amazon SageMaker now supports using manifest files to specify the location of uncompressed model artifacts within Model Packages
* api-change:``sagemaker-metrics``: This release introduces support for the SageMaker Metrics BatchGetMetrics API.
* api-change:``workspaces``: Releasing new ErrorCodes for SysPrep failures during ImageImport and CreateImage process
* enhancement:paginator: Add warning when a non-positive value is provided for the max-items pagination parameter.


1.34.23
=======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import os

__version__ = '1.34.23'
__version__ = '1.34.24'

#
# Get our data path to be added to botocore's search path
Expand Down
9 changes: 9 additions & 0 deletions awscli/customizations/paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
"""
import logging
import sys
from functools import partial

from awscli.customizations.utils import uni_print
from botocore import xform_name
from botocore.exceptions import DataNotFoundError, PaginationError
from botocore import model
Expand Down Expand Up @@ -266,6 +268,11 @@ def __init__(self, name, documentation, parse_type, serialized_name):
self._parse_type = parse_type
self._required = False

def _emit_non_positive_max_items_warning(self):
uni_print(
"warning: Non-positive values for --max-items may result in undefined behavior.\n",
sys.stderr)

@property
def cli_name(self):
return '--' + self._name
Expand All @@ -292,6 +299,8 @@ def add_to_parser(self, parser):

def add_to_params(self, parameters, value):
if value is not None:
if self._serialized_name == 'MaxItems' and int(value) <= 0:
self._emit_non_positive_max_items_warning()
pagination_config = parameters.get('PaginationConfig', {})
pagination_config[self._serialized_name] = value
parameters['PaginationConfig'] = pagination_config
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.34.'
# The full version, including alpha/beta/rc tags.
release = '1.34.23'
release = '1.34.24'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore==1.35.23
botocore==1.35.24
docutils>=0.10,<0.17
s3transfer>=0.10.0,<0.11.0
PyYAML>=3.10,<6.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def find_version(*file_paths):


install_requires = [
'botocore==1.35.23',
'botocore==1.35.24',
'docutils>=0.10,<0.17',
's3transfer>=0.10.0,<0.11.0',
'PyYAML>=3.10,<6.1',
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/customizations/test_paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import pytest

from awscli.customizations.paginate import PageArgument
from awscli.testutils import mock, unittest

from botocore.exceptions import DataNotFoundError, PaginationError
Expand All @@ -18,6 +21,9 @@

from awscli.customizations import paginate

@pytest.fixture
def max_items_page_arg():
return PageArgument('max-items', 'documentation', int, 'MaxItems')

class TestPaginateBase(unittest.TestCase):

Expand Down Expand Up @@ -321,3 +327,20 @@ def test_can_handle_missing_page_size(self):
del self.parsed_args.page_size
self.assertIsNone(paginate.ensure_paging_params_not_set(
self.parsed_args, {}))


class TestNonPositiveMaxItems:
def test_positive_integer_does_not_raise_warning(self, max_items_page_arg, capsys):
max_items_page_arg.add_to_params({}, 1)
captured = capsys.readouterr()
assert captured.err == ""

def test_zero_raises_warning(self, max_items_page_arg, capsys):
max_items_page_arg.add_to_params({}, 0)
captured = capsys.readouterr()
assert "Non-positive values for --max-items" in captured.err

def test_negative_integer_raises_warning(self, max_items_page_arg, capsys):
max_items_page_arg.add_to_params({}, -1)
captured = capsys.readouterr()
assert "Non-positive values for --max-items" in captured.err

0 comments on commit 51dc74f

Please sign in to comment.