From 5eb69ed1e89abb14b635bacb0a17e6b791562c8b Mon Sep 17 00:00:00 2001 From: basil-k-aji-dev <70605804+basil-k-aji-dev@users.noreply.github.com> Date: Sat, 3 Oct 2026 11:39:43 +0530 Subject: [PATCH] feat(presidio): type the sequence map the fallback suffix reads seq_map was an untyped dict, so the lookup is Any and str() around it is an unknown argument. The old code interpolated the same value into an f-string, where an Any costs nothing, which is why the count moved only once the fallback became a call. basedpyright on this file: 75 reportUnknownArgumentType, the same as on main. --- 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 2cbb6c4e8ac..d5d1382e635 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py +++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py @@ -859,7 +859,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail): # Assign sequence numbers in forward (left-to-right) order so # that is the first entity in the text, etc. sorted_forward: Final = sorted(analyze_results, key=lambda x: x["start"]) - seq_map: Final = {} + seq_map: Final[dict[tuple[int, int], int]] = {} for idx, ar in enumerate(sorted_forward, start=1): seq_map[(ar["start"], ar["end"])] = idx