Skip to content

Commit

Permalink
Merge branch 'release-1.33.3'
Browse files Browse the repository at this point in the history
* release-1.33.3:
  Bumping version to 1.33.3
  Add changelog entries from botocore
  Add version floor for transfer feature (#3957)
  Improve UnknownAPIVersionError exception message (#3955)
  • Loading branch information
aws-sdk-python-automation committed Nov 29, 2023
2 parents 5351917 + de0b456 commit 3f84dbb
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 6 deletions.
47 changes: 47 additions & 0 deletions .changes/1.33.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"category": "``application-autoscaling``",
"description": "[``botocore``] Amazon SageMaker customers can now use Application Auto Scaling to automatically scale the number of Inference Component copies across an endpoint to meet the varying demand of their workloads.",
"type": "api-change"
},
{
"category": "``cleanrooms``",
"description": "[``botocore``] AWS Clean Rooms now provides differential privacy to protect against user-identification attempts and machine learning modeling to allow two parties to identify similar users in their data.",
"type": "api-change"
},
{
"category": "``cleanroomsml``",
"description": "[``botocore``] Public Preview SDK release of AWS Clean Rooms ML APIs",
"type": "api-change"
},
{
"category": "``opensearch``",
"description": "[``botocore``] Launching Amazon OpenSearch Service support for new zero-ETL integration with Amazon S3. Customers can now manage their direct query data sources to Amazon S3 programatically",
"type": "api-change"
},
{
"category": "``opensearchserverless``",
"description": "[``botocore``] Amazon OpenSearch Serverless collections support an additional attribute called standby-replicas. This allows to specify whether a collection should have redundancy enabled.",
"type": "api-change"
},
{
"category": "``sagemaker-runtime``",
"description": "[``botocore``] Update sagemaker-runtime client to latest version",
"type": "api-change"
},
{
"category": "``sagemaker``",
"description": "[``botocore``] This release adds following support 1/ Improved SDK tooling for model deployment. 2/ New Inference Component based features to lower inference costs and latency 3/ SageMaker HyperPod management. 4/ Additional parameters for FM Fine Tuning in Autopilot",
"type": "api-change"
},
{
"category": "``sts``",
"description": "[``botocore``] Documentation updates for AWS Security Token Service.",
"type": "api-change"
},
{
"category": "``endpoint-rules``",
"description": "[``botocore``] Update endpoint-rules client to latest version",
"type": "api-change"
}
]
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
CHANGELOG
=========

1.33.3
======

* api-change:``application-autoscaling``: [``botocore``] Amazon SageMaker customers can now use Application Auto Scaling to automatically scale the number of Inference Component copies across an endpoint to meet the varying demand of their workloads.
* api-change:``cleanrooms``: [``botocore``] AWS Clean Rooms now provides differential privacy to protect against user-identification attempts and machine learning modeling to allow two parties to identify similar users in their data.
* api-change:``cleanroomsml``: [``botocore``] Public Preview SDK release of AWS Clean Rooms ML APIs
* api-change:``opensearch``: [``botocore``] Launching Amazon OpenSearch Service support for new zero-ETL integration with Amazon S3. Customers can now manage their direct query data sources to Amazon S3 programatically
* api-change:``opensearchserverless``: [``botocore``] Amazon OpenSearch Serverless collections support an additional attribute called standby-replicas. This allows to specify whether a collection should have redundancy enabled.
* api-change:``sagemaker-runtime``: [``botocore``] Update sagemaker-runtime client to latest version
* api-change:``sagemaker``: [``botocore``] This release adds following support 1/ Improved SDK tooling for model deployment. 2/ New Inference Component based features to lower inference costs and latency 3/ SageMaker HyperPod management. 4/ Additional parameters for FM Fine Tuning in Autopilot
* api-change:``sts``: [``botocore``] Documentation updates for AWS Security Token Service.
* api-change:``endpoint-rules``: [``botocore``] Update endpoint-rules client to latest version


1.33.2
======

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.33.2'
__version__ = '1.33.3'


# The default Boto3 session; autoloaded when needed.
Expand Down
2 changes: 1 addition & 1 deletion boto3/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class UnknownAPIVersionError(
):
def __init__(self, service_name, bad_api_version, available_api_versions):
msg = (
f"The '{service_name}' resource does not an API version of: {bad_api_version}\n"
f"The '{service_name}' resource does not support an API version of: {bad_api_version}\n"
f"Valid API versions are: {available_api_versions}"
)
# Not using super because we don't want the DataNotFoundError
Expand Down
18 changes: 17 additions & 1 deletion boto3/s3/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def create_transfer_manager(client, config, osutil=None):


def _should_use_crt(config):
if HAS_CRT:
# This feature requires awscrt>=0.19.17
if HAS_CRT and has_minimum_crt_version((0, 19, 17)):
is_optimized_instance = awscrt.s3.is_optimized_for_system()
else:
is_optimized_instance = False
Expand All @@ -205,6 +206,21 @@ def _should_use_crt(config):
return False


def has_minimum_crt_version(minimum_version):
"""Not intended for use outside boto3."""
if not HAS_CRT:
return False

crt_version_str = awscrt.__version__
try:
crt_version_ints = map(int, crt_version_str.split("."))
crt_version_tuple = tuple(crt_version_ints)
except (TypeError, ValueError):
return False

return crt_version_tuple >= minimum_version


def _create_default_transfer_manager(client, config, osutil):
"""Create the default TransferManager implementation for s3transfer."""
executor_cls = None
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.33.2,<1.34.0
botocore>=1.33.3,<1.34.0
jmespath>=0.7.1,<2.0.0
s3transfer>=0.8.0,<0.9.0

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


requires = [
'botocore>=1.33.2,<1.34.0',
'botocore>=1.33.3,<1.34.0',
'jmespath>=0.7.1,<2.0.0',
's3transfer>=0.8.0,<0.9.0',
]
Expand Down
17 changes: 16 additions & 1 deletion tests/functional/test_crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
from botocore.compat import HAS_CRT
from botocore.credentials import Credentials

from boto3.s3.transfer import TransferConfig, create_transfer_manager
from boto3.s3.transfer import (
TransferConfig,
create_transfer_manager,
has_minimum_crt_version,
)
from tests import mock, requires_crt

if HAS_CRT:
Expand Down Expand Up @@ -62,3 +66,14 @@ def test_create_transfer_manager_on_optimized_instance(self):
config = TransferConfig()
transfer_manager = create_transfer_manager(client, config)
assert isinstance(transfer_manager, CRTTransferManager)

@requires_crt()
def test_minimum_crt_version(self):
assert has_minimum_crt_version((0, 16, 12)) is True

@requires_crt()
def test_minimum_crt_version_bad_crt_version(self):
with mock.patch("awscrt.__version__") as vers:
vers.return_value = None

assert has_minimum_crt_version((0, 16, 12)) is False

0 comments on commit 3f84dbb

Please sign in to comment.