From a9cbee17c6cace2b3c179f59318af57b2442a7dc Mon Sep 17 00:00:00 2001 From: yucheng Date: Tue, 29 Sep 2026 11:32:19 +0000 Subject: [PATCH] refactor(logging): drop Any cast in failure redaction flag lookup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/redact_messages.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/litellm_core_utils/redact_messages.py b/litellm/litellm_core_utils/redact_messages.py index a4b01c22875..ddc3e17326f 100644 --- a/litellm/litellm_core_utils/redact_messages.py +++ b/litellm/litellm_core_utils/redact_messages.py @@ -233,9 +233,7 @@ def should_redact_failed_request(request_data: Mapping[str, object]) -> bool: else next( ( slot["turn_off_message_logging"] - for _, slot in iter_client_callback_metadata_dicts( - cast(dict[str, Any], request_data) # cast-ok: the helper only reads mapping keys - ) + for _, slot in iter_client_callback_metadata_dicts(dict(request_data)) if "turn_off_message_logging" in slot ), None,