From da39634c16b9b442bb957c594550696b33c3ffbf Mon Sep 17 00:00:00 2001 From: musi22 Date: Mon, 21 Sep 2026 23:47:35 +0530 Subject: [PATCH] fix(presidio): restore setattr with noqa B010 to satisfy type checking --- litellm/proxy/guardrails/guardrail_hooks/presidio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.py index 0b156f174d6..4a9eeb3f4f3 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py +++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py @@ -1628,7 +1628,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail): if not getattr(assembled_model_response, "usage", None) and chunks: last_chunk_usage: Final = getattr(chunks[-1], "usage", None) if last_chunk_usage: - assembled_model_response.usage = last_chunk_usage + setattr(assembled_model_response, "usage", last_chunk_usage) # noqa: B010 def get_presidio_settings_from_request_data(self, data: dict) -> PresidioPerRequestConfig | None: if "metadata" in data: