Fix: resolved mismatched PII entity labels causing exceptions in microsoft_presidio_pii.py#41
Closed
inatimi-johnson wants to merge 1 commit intoEdyVision:mainfrom
Closed
Conversation
…t_presidio_pii.py AU_TFN to TFN: The tax file number (TFN) is a unique identifier issued by the Australian Taxation Office to each taxpaying entity. The mismatch caused the exception 'An error occurred while processing the detected entity AU_TFN'. Updated to TFN, which resolved the error through consistent pattern match, context, and checksum validation. AU_ACN to ACN: The Australian Company Number (ACN) identifier caused similar context mismatches. Standardized to ACN for uniform entity handling. US_PASSPORT to PASSPORT: Adjusted entity label to PASSPORT to avoid region-specific ambiguity and ensure accurate detection. US_ITIN to ITIN: Standardized entity naming to ITIN to maintain consistent reference across regions and prevent label misclassification. These changes ensure consistent entity naming, reduce regional dependency, and resolve prior exceptions during entity detection.
Owner
|
Thanks for the PR, but this change cannot be merged in. The enum values in MSFTPresidioPIIType have to match exactly what Presidio’s analyzer returns (e.g. "AU_TFN", "AU_ACN", "US_PASSPORT", "US_ITIN"), because we look them up with that string. If we rename those to "TFN", "ACN", "PASSPORT", and "ITIN", Presidio will still send the original region-prefixed names and we’ll get lookup failures or wrong mappings. So we need to keep the names aligned with Presidio’s supported-entities API and recognizers, not with a “cleaner” naming scheme. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…t_presidio_pii.py
AU_TFN to TFN: The tax file number (TFN) is a unique identifier issued by the Australian Taxation Office to each taxpaying entity. The mismatch caused the exception 'An error occurred while processing the detected entity AU_TFN'. Updated to TFN, which resolved the error through consistent pattern match, context, and checksum validation.
AU_ACN to ACN: The Australian Company Number (ACN) identifier caused similar context mismatches. Standardized to ACN for uniform entity handling.
US_PASSPORT to PASSPORT: Adjusted entity label to PASSPORT to avoid region-specific ambiguity and ensure accurate detection.
US_ITIN to ITIN: Standardized entity naming to ITIN to maintain consistent reference across regions and prevent label misclassification.
These changes ensure consistent entity naming, reduce regional dependency, and resolve prior exceptions during entity detection.
Overview
PR description. Explain what it's doing and why.
Checklist