From 6abbb79935a7db720269dbdfab62c14e8d2e906e Mon Sep 17 00:00:00 2001 From: rsd-darshan Date: Thu, 27 Aug 2026 11:31:00 +0545 Subject: [PATCH] fix(bedrock): satisfy CI lint gates on the passthrough fallback Two checks failed after the rebase: - type-discipline budget (LIT002): the {} default in model_call_details.get("litellm_params", {}) is a mutable-literal construction; mark it mutable-ok like the identical pattern used elsewhere in the codebase. - lazy-logging test: the warning built its message eagerly via an f-string; switch to %-style args so the interpolation is skipped when the warning is filtered out. --- litellm/llms/bedrock/passthrough/transformation.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/litellm/llms/bedrock/passthrough/transformation.py b/litellm/llms/bedrock/passthrough/transformation.py index e0f69f29e8d..9fe50db66a7 100644 --- a/litellm/llms/bedrock/passthrough/transformation.py +++ b/litellm/llms/bedrock/passthrough/transformation.py @@ -206,15 +206,17 @@ 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", + {}, # mutable-ok: read-only empty fallback + ).get("model", "") if 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}. " - "Skipping streaming response logging for this passthrough request." + "Could not determine Bedrock invoke provider for model: %r. " + "Skipping streaming response logging for this passthrough request.", + model, ) return None obj = get_bedrock_event_stream_decoder(