From a7391b8fdb8d99545da0c9a5fbbfc43b80f11067 Mon Sep 17 00:00:00 2001 From: lzhan011 <35493221+lzhan011@users.noreply.github.com> Date: Sat, 24 Oct 2026 21:09:55 -0500 Subject: [PATCH] fix(guardrails): mark RestrictedPython's unpack guard as untyped The guarded_unpack_sequence import is partially unknown to basedpyright, which put reportUnknownVariableType one over its merge-base ceiling. RestrictedPython ships no type information, so suppress it on that line with the reason, the form the type-discipline gate accepts. --- litellm/proxy/guardrails/guardrail_hooks/custom_code/sandbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/custom_code/sandbox.py b/litellm/proxy/guardrails/guardrail_hooks/custom_code/sandbox.py index 63c731fe5ff..4f362f278d6 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/custom_code/sandbox.py +++ b/litellm/proxy/guardrails/guardrail_hooks/custom_code/sandbox.py @@ -31,7 +31,7 @@ from RestrictedPython.Eval import default_guarded_getitem from RestrictedPython.Guards import ( full_write_guard, guarded_iter_unpack_sequence, - guarded_unpack_sequence, + guarded_unpack_sequence, # pyright: ignore[reportUnknownVariableType] # RestrictedPython is untyped safer_getattr, ) from RestrictedPython.transformer import copy_locations