Repository navigation
Python: fix(bedrock): resolve the BedrockEmbeddingClient region like the chat client - #9349
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 16, 2026
Conversation
Md. Shalah Uddin (shanto462)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 13, 2026 16:29
Md. Shalah Uddin (shanto462)
deployed
to
github-app-auth
October 13, 2026 16:29 — with
GitHub Actions
Active
Md. Shalah Uddin (shanto462)
deployed
to
github-app-auth
October 13, 2026 16:29 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the documented behavior and includes focused regression coverage.
0 open findings
What changed in this PR
Aligns Bedrock embedding region resolution with the intended precedence while preserving boto3 defaults.
Changes:
- Prioritizes configured regions over session regions.
- Keeps
client.regionconsistent with the runtime region. - Adds regression coverage and updates docstrings.
| File | Description |
|---|---|
_embedding_client.py |
Corrects region resolution and documentation. |
test_bedrock_embedding_client.py |
Tests region precedence, boto3 defaults, and prebuilt clients. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 16, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
BedrockEmbeddingClientbuilt its runtime client withregion_name=boto3_session.region_name or resolved_region, so a provided session's region won over an explicitregionorBEDROCK_REGION. Itsregionattribute was always the configured region or us-east-1, even when requests went to the session's region or to the region boto3 resolved from its own configuration.BedrockChatClientalready resolves the region in the expected order (#9249).Description & Review Guide
region/BEDROCK_REGION, then the session's region (or boto3's own configuration when no session is passed, as before), then us-east-1, and uses that same value for the runtime client and forclient.region. Bothregiondocstrings describe this order. Regression tests mirror the chat client's from Python: fix(bedrock): use the boto3 session's region in BedrockChatClient #9249: a parametrized session test (session region,regionargument wins,BEDROCK_REGIONwins, default), a test that boto3's default region is reported, and a test that a pre-builtclientstill ignores the session.regionkeeps the session's region.client.regionnow matches the region in use. Nothing changes when a pre-builtclientis passed, and credentials handling is unchanged.Related Issue
Fixes #9348
No other open PR covers this issue.
AI Assistance
AI assistance details: issue analysis, implementation, tests, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.