From a29a55bd68908f06b2fdb5aef51584d2a3d6fb64 Mon Sep 17 00:00:00 2001 From: Quinn Xu Date: Mon, 5 Oct 2026 10:12:27 -0700 Subject: [PATCH] fix(guardrails): drop stale mutable-ok marker in GuardrailToolParam serializer The dict comprehension is not flagged by the mutable-collection rule, so the suppression comment suppressed nothing and tripped LIT013. --- .../proxy/guardrails/guardrail_hooks/generic_guardrail_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/generic_guardrail_api.py b/litellm/types/proxy/guardrails/guardrail_hooks/generic_guardrail_api.py index f33db7a42bd..3c4dd4faeb2 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/generic_guardrail_api.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/generic_guardrail_api.py @@ -29,9 +29,7 @@ class GuardrailToolParam(BaseModel): data: Final[Mapping[str, object]] = handler(self) if not isinstance(data, dict) or data.get("type") is not None: return data - return { # mutable-ok: pydantic's json serializer rejects a mapping that is not a dict - key: value for key, value in data.items() if key != "type" - } + return {key: value for key, value in data.items() if key != "type"} class GenericGuardrailAPIMetadata(TypedDict, total=False):