Add DLP code samples for custom info types (#1524) · cache91/python-docs-samples@87ce0ff · GitHub
Skip to content

Commit 87ce0ff

Browse files
mwdaubandrewsg
authored andcommitted
Add DLP code samples for custom info types (GoogleCloudPlatform#1524)
* Add custom info type samples to inspect_content.py Use flags to indicate dictionary word lists and regex patterns, then parse them into custom info types. * Make code compatible with python 2.7 * Add missing commas * Remove bad import * Add tests for custom info types * Add info_types parameter to deid.py * Update deid tests to use info_types parameter * Fix indentation * Add blank lines * Share logic for building custom info types * Fix line too long * Fix typo. * Revert "Fix typo." This reverts commit b4ffea6, so that the sharing of the custom info type logic can be reverted as well to make the code samples more readable. * Revert "Share logic for building custom info types" This reverts commit 47fc04f. This makes the code samples more readable. * Switch from indexes to using enumerate. * Updated help message for custom dictionaries. * Fix enumerate syntax error.
1 parent 5e5ea6d commit 87ce0ff

4 files changed

Lines changed: 268 additions & 12 deletions

File tree

dlp/deid.py

Lines changed: 33 additions & 6 deletions

dlp/deid_test.py

Lines changed: 8 additions & 2 deletions

0 commit comments

Comments
 (0)