diff --git a/.changes/1.34.24.json b/.changes/1.34.24.json new file mode 100644 index 000000000000..ea8d84927015 --- /dev/null +++ b/.changes/1.34.24.json @@ -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" + } +] \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 66b8eb65f9ce..812223dddb8a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 ======= diff --git a/awscli/__init__.py b/awscli/__init__.py index bff2030be09e..02b2e03455a3 100644 --- a/awscli/__init__.py +++ b/awscli/__init__.py @@ -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 diff --git a/awscli/customizations/paginate.py b/awscli/customizations/paginate.py index c1400c5758e3..fe1f3f140112 100644 --- a/awscli/customizations/paginate.py +++ b/awscli/customizations/paginate.py @@ -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 @@ -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 @@ -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 diff --git a/doc/source/conf.py b/doc/source/conf.py index c4a891d590a3..ebed2c7f375e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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. diff --git a/setup.cfg b/setup.cfg index 981362f3f0c8..eb4ce2d7a911 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 16f0fae8cef9..6f324f1f787f 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/tests/unit/customizations/test_paginate.py b/tests/unit/customizations/test_paginate.py index e4e4e018975e..cb362a0fc631 100644 --- a/tests/unit/customizations/test_paginate.py +++ b/tests/unit/customizations/test_paginate.py @@ -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 @@ -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): @@ -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