Skip to content

Fix: resolved mismatched PII entity labels causing exceptions in microsoft_presidio_pii.py#41

Closed
inatimi-johnson wants to merge 1 commit intoEdyVision:mainfrom
inatimi-johnson:fix-pii-entity-labels
Closed

Fix: resolved mismatched PII entity labels causing exceptions in microsoft_presidio_pii.py#41
inatimi-johnson wants to merge 1 commit intoEdyVision:mainfrom
inatimi-johnson:fix-pii-entity-labels

Conversation

@inatimi-johnson
Copy link
Copy Markdown

…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.

  • Implementation details...
  • Bugfix details...

Checklist

  • New PII Detection Service Added (Optional)
  • New PII Mappings added (Optional)
  • New citations added (if using other open source or research software) (Optional)
  • New PII types added to new version file under pii_codex/data (and JSON file generated) (Optional)
  • Tests added
  • CI passed
  • Commits Squashed

…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.
@EdyVision
Copy link
Copy Markdown
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.

@EdyVision EdyVision closed this Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants