Reset deanonymizer mapping (#11559)

@hwchase17 @baskaryan
pull/11570/head
maks-operlejn-ds 1 year ago committed by GitHub
parent b14b65d62a
commit f64522fbaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,3 +47,7 @@ class ReversibleAnonymizerBase(AnonymizerBase):
deanonymizer_matching_strategy: Callable[[str, MappingDataType], str],
) -> str:
"""Abstract method to deanonymize text"""
@abstractmethod
def reset_deanonymizer_mapping(self) -> None:
"""Abstract method to reset deanonymizer mapping"""

@ -313,6 +313,10 @@ class PresidioReversibleAnonymizer(PresidioAnonymizerBase, ReversibleAnonymizerB
return text_to_deanonymize
def reset_deanonymizer_mapping(self) -> None:
"""Reset the deanonymizer mapping"""
self._deanonymizer_mapping = DeanonymizerMapping()
def save_deanonymizer_mapping(self, file_path: Union[Path, str]) -> None:
"""Save the deanonymizer mapping to a JSON or YAML file.

Loading…
Cancel
Save