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:
basil-k-aji-dev 2026-10-03 11:39:43 +05:30
parent b2fcef83cc
commit 5eb69ed1e8

View file

@ -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