feat(anonymizer): add batch deanonymization support#2115
Open
rodboev wants to merge 5 commits into
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new public BatchDeanonymizeEngine to presidio-anonymizer to support batch deanonymization over lists and nested dictionaries, mirroring the ergonomics of BatchAnonymizerEngine, with documentation and tests.
Changes:
- Introduces
BatchDeanonymizeEngineand exports it frompresidio_anonymizer. - Adds unit tests and extends the README tests to cover the new batch deanonymization example.
- Updates
presidio-anonymizer/README.mdand rootCHANGELOG.mdto document the new capability.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| presidio-anonymizer/presidio_anonymizer/batch_deanonymize_engine.py | New batch deanonymization implementation for lists and nested dicts. |
| presidio-anonymizer/presidio_anonymizer/init.py | Exposes BatchDeanonymizeEngine from the package root. |
| presidio-anonymizer/tests/test_batch_deanonymize_engine.py | Adds unit coverage for list/dict/nested behaviors and engine injection. |
| presidio-anonymizer/tests/test_readme.py | Extends README snippet tests to include batch deanonymization example. |
| presidio-anonymizer/README.md | Documents batch deanonymization usage example. |
| CHANGELOG.md | Notes the new batch deanonymization feature under Unreleased. |
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.
Change Description
Adds a public
BatchDeanonymizeEnginetopresidio-anonymizer, so encrypted values produced through the batch analyzer and anonymizer flow can be decrypted with the same list and dictionary ergonomics asBatchAnonymizerEngine.The new batch engine delegates string values to the existing
DeanonymizeEngine.deanonymize(...), supports list and nested dictionary traversal, and leaves unsupported scalar or object values unchanged. The change is additive and keeps the existing single-text deanonymization API unchanged.The README now includes a batch deanonymization example, and the changelog records the new Anonymizer feature under
Unreleased.Issue reference
Fixes #1617
Tests
poetry run pytest tests/test_batch_deanonymize_engine.py tests/integration/test_deanonymize_engine.py tests/test_batch_anonymizer_engine.py tests/test_readme.pypoetry run ruff check presidio_anonymizer/batch_deanonymize_engine.py presidio_anonymizer/__init__.py tests/test_batch_deanonymize_engine.py tests/test_readme.pyNote on CHANGELOG
Update
CHANGELOG.mdunder[unreleased]→Anonymizer→Added.Checklist