Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Change "alien id" to "alien registration"
Browse files Browse the repository at this point in the history
Replace references of "id" with "registration number" for the alien registration classes
  • Loading branch information
DJensen94 committed Jul 7, 2022
1 parent 4119fd7 commit 6e10627
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pe_source/data/helpers/redact_pii.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,21 +454,21 @@ class PassportDetector(scrubadub.detectors.RegexDetector):


# Build a detector that identifies Alien Registration Numbers
class AlienIdFilth(scrubadub.filth.Filth):
class AlienRegistrationFilth(scrubadub.filth.Filth):
"""Create filth class for Alien Registration Numbers."""

type = "alien id"
type = "alien registration"


class AlienIdDetector(scrubadub.detectors.RegexDetector):
class AlienRegistrationDetector(scrubadub.detectors.RegexDetector):
"""Create detector class to identify Alien Registration Numbers."""

name = "alien id"
name = "alien registration"
regex = re.compile(
r"^(([A-Za-z]{3}[0-9]{10})|([A-Za-z]{3}(\s)([0-9]{2}(\s)[0-9]{3}(\s)[0-9]{5})))$",
re.IGNORECASE,
)
filth_cls = AlienIdFilth
filth_cls = AlienRegistrationFilth


# Create various regex identifiers
Expand Down Expand Up @@ -511,7 +511,7 @@ def scrub(df, column):
scrubber.remove_detector("email")
scrubber.add_detector(SSNDetector)
scrubber.add_detector(PassportDetector)
scrubber.add_detector(AlienIdDetector)
scrubber.add_detector(AlienRegistrationDetector)
scrubber.add_detector(FL_DLDetector)
scrubber.add_detector(HI_NE_VA_DLDetector)
scrubber.add_detector(IL_DLDetector)
Expand Down

0 comments on commit 6e10627

Please sign in to comment.