feat(presidio): annotate the analyzer-result locals the token suffix reads

entity_type and value come out of an untyped analyzer mapping. They only fed
an f-string before, where an Any costs nothing; passing them to
_stable_token_suffix makes them call arguments, which is what the remaining
unknown-argument error was.
This commit is contained in:
basil-k-aji-dev 2026-10-03 11:25:09 +05:30
parent a0b6cd5a67
commit b2fcef83cc

View file

@ -869,8 +869,10 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail):
for ar in reversed(sorted_forward):
start = ar["start"]
end = ar["end"]
entity_type = ar["entity_type"]
value = text[start:end]
# Annotated because the analyzer result is an untyped mapping: both now
# reach _stable_token_suffix as call arguments, where an Any counts.
entity_type: str = ar["entity_type"]
value: str = text[start:end]
suffix = (
self._stable_token_suffix(entity_type, value)
if self.presidio_stable_tokens