Remove duplicate NN-NNNNNNN pattern from the SSN filter - #86
Open
HarshRajSinghania wants to merge 3 commits into
Open
HarshRajSinghania wants to merge 3 commits into
HarshRajSinghania wants to merge 3 commits into
Conversation
added 3 commits
September 15, 2026 18:17
The EIN-shaped form is already detected by EINFilter. Leaving a copy in SSNFilter mislabels the value as an SSN when ein is not enabled. Fixes philterd#84.
This branch has not been deployed
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.
Summary
Removes the duplicate
NN-NNNNNNNpattern fromSSNFilterso that form is only detected as an EIN.Fixes #84.
Motivation
ssn_filter.pyandein_filter.pycompiled the same regex and attributed it to different entity types. The SSN copy existed only to be outscored wheneinwas also enabled. Wheneinwas off,12-3456789was reported as an SSN. PhiSQL has no TIN type; the only taxpayer number writtenNN-NNNNNNNis an EIN.Implementation
_TIN_PATTERNSand_TIN_CONFIDENCEfromphileas/filters/ssn_filter.py.SSNFilter.detectnow returns only SSN forms.EINFilterunchanged.ssn-only policy does not detect12-3456789, aneinpolicy does, and the redacted text is asserted.docs/filters.mdanddocs/index.mdso TIN language is not attached to the SSN filter.RELEASE_NOTES.md(Unreleased).Testing
Result: 145 passed.