From e43a4d96df1d75855de7be9e230d796dfcbe3b15 Mon Sep 17 00:00:00 2001 From: lzhan011 <35493221+lzhan011@users.noreply.github.com> Date: Sat, 24 Oct 2026 21:09:56 -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 5681438d8d9..c30fe70ccff 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