Breaking changes in 0.10.0: async client configuration
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- aws, python
調査の方向性
リポジトリのファイルもテストも指定されていません。まず、バージョン 0.10.0 のリリースノートまたは移行ドキュメントがどこで管理されているかを確認し、次に、文書化されている AsyncConfig の import、resolve() の使用方法、plugin の型、バージョン固定の例を issue と比較します。プロジェクトで確立されているドキュメントの場所に breaking-change guidance が公開されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Breaking changes in 0.10.0 release
Starting with version 0.10.0, the aws-sdk-* client packages include breaking changes to client configuration.
New configuration object
The synchronous Config class previously exported from each service package has been replaced with a service-specific asynchronous configuration class.
For example, for Bedrock Runtime:
# Before
from aws_sdk_bedrock_runtime.config import Config
is now:
# 0.10.0 and later
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
Configuration is now asynchronous
Configuration objects must now be created using the asynchronous resolve() method. Directly instantiating the configuration class is not supported and results in an error.
# Incorrect
config = AsyncBedrockRuntimeConfig(
region="us-west-2",
)
# Raises
smithy_aws_core.config.exceptions.ConfigError: AsyncBedrockRuntimeConfig cannot be constructed directly. Use `await AsyncBedrockRuntimeConfig.resolve(...)` instead.
Instead, resolve the configuration before passing it to the client:
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
config = await AsyncBedrockRuntimeConfig.resolve(
region="us-west-2",
)
This change allows the SDK to perform configuration resolution that requires I/O, such as reading shared AWS configuration and credentials files, without blocking the event loop.
Configuration values are resolved from explicit overrides passed to resolve(), environment variables, and shared AWS configuration and credentials files. If no configuration is provided when constructing a client, the SDK automatically resolves one for you.
Plugins
Configuration plugins must now receive the service-specific asynchronous configuration type, Async<ServiceId>Config, instead of the previous Config type.
For example:
# Before
from aws_sdk_bedrock_runtime.config import Config
def my_plugin(config: Config) -> None:
...
is now:
# 0.10.0 and later
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
def my_plugin(config: AsyncBedrockRuntimeConfig) -> None:
...
Migrating existing applications
Update configuration usage as follows:
- Replace imports of
Configwith the service-specificAsync<ServiceId>Config. - Replace direct configuration construction with
await Async<ServiceId>Config.resolve(...). - Ensure explicit configuration resolution occurs within an asynchronous context.
- Update configuration plugins to accept the service-specific
Async<ServiceId>Configtype instead ofConfig.
For example:
# Before
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
from aws_sdk_bedrock_runtime.config import Config
def my_plugin(config: Config) -> None:
...
config = Config(
region="us-west-2",
)
client = AsyncBedrockRuntimeClient(
config=config,
plugins=[my_plugin],
)
becomes:
# 0.10.0 and later
from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient
from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig
def my_plugin(config: AsyncBedrockRuntimeConfig) -> None:
...
config = await AsyncBedrockRuntimeConfig.resolve(
region="us-west-2",
)
client = AsyncBedrockRuntimeClient(
config=config,
plugins=[my_plugin],
)
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 explicitly require version 0.10.0 or later:
python -m pip install "aws-sdk-bedrock-runtime>=0.10.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.10.0"
To allow compatible patch releases while avoiding newer minor releases:
python -m pip install "aws-sdk-bedrock-runtime~=0.10.0"
This is important while the SDK is pre-1.0.0, when minor releases may include breaking changes.
- 主要言語
- Python
- スター
- 171
- フォーク
- 24
- 平均マージ
- 10時間 47分
- マージ済み PR(30日)
- 7
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-sdk-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/aws-sdk-python#13 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
aws/aws-sdk-python#99 ·
-
Support Python 3.11オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
aws/aws-sdk-python#92 ·
-
announcement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
aws/aws-sdk-python#90 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
aws/aws-sdk-python#18 ·
aws/aws-sdk-python の issue をすべて見る
似ている issue
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openvinotoolkit/openvino_notebooks#3665 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
docs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
benchmark-gap
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信