mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
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.
This commit is contained in:
parent
b2fcef83cc
commit
5eb69ed1e8
1 changed files with 1 additions and 1 deletions
|
|
@ -859,7 +859,7 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
|
|||
# Assign sequence numbers in forward (left-to-right) order so
|
||||
# that <PERSON_1> 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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue