style(bedrock): apply ruff format after rebase onto upstream/main

Rebasing fix/bedrock-passthrough-inference-profile-logging onto
upstream/main surfaced two merge conflicts (transformation.py and the
passthrough test file) against unrelated refactors that landed since
this branch diverged. This applies diff-scoped ruff format to the
lines touched by the conflict resolution, matching CI's format check.
This commit is contained in:
rsd-darshan 2026-08-27 10:34:38 +05:45
parent 117254f670
commit a978a7963b
No known key found for this signature in database
GPG key ID: 5317D533B1678165
2 changed files with 6 additions and 13 deletions

View file

@ -206,13 +206,11 @@ class BedrockPassthroughConfig(BaseAWSLLM, BedrockModelInfo, BedrockEventStreamD
# Application Inference Profile ARNs don't encode provider info in the ARN
# itself. Try to derive the provider from the original LiteLLM model name
# (e.g. "global.anthropic.claude-opus-4-7") stored in logging context.
fallback_model: Final = litellm_logging_obj.model_call_details.get(
"litellm_params", {}
).get("model", "")
fallback_model: Final = litellm_logging_obj.model_call_details.get("litellm_params", {}).get(
"model", ""
)
if fallback_model:
invoke_provider = AmazonInvokeConfig.get_bedrock_invoke_provider(
fallback_model
)
invoke_provider = AmazonInvokeConfig.get_bedrock_invoke_provider(fallback_model)
if invoke_provider is None:
verbose_logger.warning(
f"Could not determine Bedrock invoke provider for model: {model!r}. "

View file

@ -1,6 +1,5 @@
from unittest.mock import MagicMock, patch
from litellm.llms.bedrock.passthrough.transformation import BedrockPassthroughConfig
@ -524,13 +523,9 @@ def test_handle_logging_collected_chunks_inference_profile_arn_falls_back_gracef
# Intercept the decoder so we don't need real botocore event-stream bytes.
# The import is done inside handle_logging_collected_chunks, so patch the source module.
with patch(
"litellm.llms.bedrock.chat.get_bedrock_event_stream_decoder"
) as mock_decoder:
with patch("litellm.llms.bedrock.chat.get_bedrock_event_stream_decoder") as mock_decoder:
mock_chunk_obj = MagicMock()
mock_chunk_obj._chunk_parser.return_value = (
{}
) # not a valid GenericStreamingChunk
mock_chunk_obj._chunk_parser.return_value = {} # not a valid GenericStreamingChunk
mock_decoder.return_value = mock_chunk_obj
# Must not raise ValueError.