Breaking changes in 0.11.0: deprecated client aliases and default HTTP transport
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- aws, python
调研方向
该 issue 描述了 0.11.0 的客户端别名、传输、清理和迁移示例,但没有指出任何仓库文件、测试或文档入口。首先确定预期的文档位置,并确认维护者希望的范围;完成的标准应是已经达成一致的目标和验收标准,且涵盖已记录的 breaking changes。
由索引模型根据 Issue 内容生成。
描述
Breaking changes in 0.11.0 release
Starting with version 0.11.0, the aws-sdk-* client packages include breaking changes to client names and default HTTP transports. This release also adds automatic cleanup of client HTTP resources.
Async-prefixed client names
Seven clients currently expose both an Async-prefixed client name and a deprecated unprefixed alias. Starting with version 0.11.0, these deprecated aliases are removed and only the Async<ServiceId>Client names remain. All other clients already expose only an Async-prefixed name and are not affected by this change.
The following deprecated aliases are removed:
| Deprecated alias removed | Use instead |
|---|---|
BedrockRuntimeClient |
AsyncBedrockRuntimeClient |
ConnectHealthClient |
AsyncConnectHealthClient |
LexRuntimeV2Client |
AsyncLexRuntimeV2Client |
PollyClient |
AsyncPollyClient |
QBusinessClient |
AsyncQBusinessClient |
SageMakerRuntimeHTTP2Client |
AsyncSageMakerRuntimeHTTP2Client |
TranscribeStreamingClient |
AsyncTranscribeStreamingClient |
For example, for Bedrock Runtime:
# Before
from aws_sdk_bedrock_runtime.client import BedrockRuntimeClient
must now be:
# 0.11.0 and later
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
AIOHTTPClient is now the default transport
All clients now default to the AIOHTTPClient transport, which uses the aiohttp library to send HTTP requests. This changes the default transport for the following client packages, which previously used AWSCRTHTTPClient:
aws-sdk-bedrock-agent-runtimeaws-sdk-bedrock-agentcoreaws-sdk-bedrock-runtimeaws-sdk-connecthealthaws-sdk-lambdaaws-sdk-lex-runtime-v2aws-sdk-pollyaws-sdk-qbusinessaws-sdk-sagemaker-runtime-http2aws-sdk-transcribe-streaming
[!IMPORTANT]
AIOHTTPClientdoes not support HTTP/2 or bidirectional event streams. Applications that require either must install theawscrtoptional extra and explicitly configure the CRT transport.
For example, install the Bedrock Runtime client with CRT support:
python -m pip install "aws-sdk-bedrock-runtime[awscrt]"
Then pass an AWSCRTHTTPClient to the service-specific configuration:
from smithy_http.aio.crt import AWSCRTHTTPClient
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
config = await AsyncBedrockRuntimeConfig.resolve(
region="us-west-2",
transport=AWSCRTHTTPClient(),
)
async with AsyncBedrockRuntimeClient(config=config) as client:
...
Applications that do not require HTTP/2, bidirectional event streams, or other CRT-specific functionality do not need to override the transport.
Client resource cleanup
Clients are now asynchronous context managers. Exiting the context automatically closes the underlying transport and cleans up HTTP resources such as sessions and connection pools.
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
async with AsyncBedrockRuntimeClient() as client:
...
We recommend using clients as asynchronous context managers. Applications that manage the client lifecycle directly can instead call close():
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
client = AsyncBedrockRuntimeClient()
try:
...
finally:
await client.close()
A client cannot be reused after its context exits or after close() is called.
Migrating existing applications
Update client usage as follows:
- Replace affected unprefixed client names with the corresponding
Async<ServiceId>Clientname. - If your application requires the CRT transport, install the client package with its
awscrtoptional extra, resolve anAsync<ServiceId>Configwithtransport=AWSCRTHTTPClient(), and pass that configuration to the client. - Use the client as an asynchronous context manager or call
await client.close()when the client is no longer needed.
For example:
# Before
from aws_sdk_bedrock_runtime.client import BedrockRuntimeClient
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
config = await AsyncBedrockRuntimeConfig.resolve(
region="us-west-2",
)
client = BedrockRuntimeClient(
config=config,
)
becomes:
# 0.11.0 and later
from smithy_http.aio.crt import AWSCRTHTTPClient
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
config = await AsyncBedrockRuntimeConfig.resolve(
region="us-west-2",
transport=AWSCRTHTTPClient(),
)
async with AsyncBedrockRuntimeClient(config=config) as client:
...
The explicit CRT transport in this example is only required for applications that need HTTP/2, bidirectional event streams, or other CRT-specific functionality.
Installing the latest version
Upgrade an existing client package with pip:
python -m pip install --upgrade aws-sdk-<service-id>
For example:
python -m pip install --upgrade aws-sdk-bedrock-runtime
To install the optional CRT transport:
python -m pip install --upgrade "aws-sdk-bedrock-runtime[awscrt]"
To explicitly require version 0.11.0 or later:
python -m pip install "aws-sdk-bedrock-runtime>=0.11.0"
Pinning versions
To avoid unexpected breaking changes when installing or deploying your application, we recommend pinning aws-sdk-* client packages to a specific version or compatible version range.
To pin to an exact version:
python -m pip install "aws-sdk-bedrock-runtime==0.11.0"
To allow compatible patch releases while avoiding newer minor releases:
python -m pip install "aws-sdk-bedrock-runtime~=0.11.0"
This is important while the SDK is pre-1.0.0, when minor releases may include breaking changes.
- 主要语言
- Python
- 星标
- 173
- 派生
- 23
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-sdk-python 的其他 Issue
-
Container credentials client sleeps after the final failed attempt可能已有人在做 @gauravkriplani 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
aws/aws-sdk-python#106 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws/aws-sdk-python#13 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
aws/aws-sdk-python#99 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
aws/aws-sdk-python#92 ·
维护者通常 1 天内回复
-
announcement
难度 3/5 1-2 天 新手友好度 35/100
aws/aws-sdk-python#84 ·
维护者通常 1 天内回复
查看 aws/aws-sdk-python 的全部 Issue
相似的 Issue
-
Layers of type "3D Unknown" and "3D Measured Unknown" are refused, so FileGDB multipatch layers can't be read可能已有人在做 @aidannewsome 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
quantization
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/vllm#59904 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
mikf/gallery-dl#9791 ·
-
Speaker custom-fields CSV export returns 404 instead of downloading data可能已有人在做 @techvoyager-varun 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
fossasia/eventyay#6151 · 1 条评论 ·
维护者通常 1 天内回复
-
P4: low tooling
难度 2/5 1-3 小时 新手友好度 88/100
jeffknupp/association#318 ·