Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetic1728 committed Aug 17, 2020
1 parent 962bdf7 commit 8b5b398
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion samples/snippets/custom_infotype.py
Expand Up @@ -265,7 +265,7 @@ def inspect_with_medical_record_number_w_custom_hotwords(
}

rule_set = [
{"info_types": [{"name": "C_MRN"}], "rules": [{"hotword_rule": hotword_rule}],}
{"info_types": [{"name": "C_MRN"}], "rules": [{"hotword_rule": hotword_rule}]}
]

# Construct the configuration dictionary with the custom regex info type.
Expand Down
6 changes: 3 additions & 3 deletions samples/snippets/deid.py
Expand Up @@ -166,7 +166,7 @@ def deidentify_with_replace(
{
"primitive_transformation": {
"replace_config": {
"new_value": {"string_value": replacement_str,}
"new_value": {"string_value": replacement_str}
}
}
}
Expand Down Expand Up @@ -244,7 +244,7 @@ def deidentify_with_fpe(
# Construct FPE configuration dictionary
crypto_replace_ffx_fpe_config = {
"crypto_key": {
"kms_wrapped": {"wrapped_key": wrapped_key, "crypto_key_name": key_name,}
"kms_wrapped": {"wrapped_key": wrapped_key, "crypto_key_name": key_name}
},
"common_alphabet": alphabet,
}
Expand Down Expand Up @@ -618,7 +618,7 @@ def map_data(value):
try:
date = datetime.strptime(value, "%m/%d/%Y")
return {
"date_value": {"year": date.year, "month": date.month, "day": date.day,}
"date_value": {"year": date.year, "month": date.month, "day": date.day}
}
except ValueError:
return {"string_value": value}
Expand Down
3 changes: 2 additions & 1 deletion samples/snippets/deid_test.py
Expand Up @@ -16,10 +16,11 @@
import shutil
import tempfile

import google.cloud.dlp_v2

import pytest

import deid
import google.cloud.dlp_v2

HARMFUL_STRING = "My SSN is 372819127"
HARMLESS_STRING = "My favorite color is blue"
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/jobs.py
Expand Up @@ -137,7 +137,7 @@ def delete_dlp_job(project, job_name):
list_parser.add_argument(
"-t",
"--type",
choices=["DLP_JOB_TYPE_UNSPECIFIED", "INSPECT_JOB", "RISK_ANALYSIS_JOB",],
choices=["DLP_JOB_TYPE_UNSPECIFIED", "INSPECT_JOB", "RISK_ANALYSIS_JOB"],
help='The type of job. API defaults to "INSPECT"',
)

Expand Down
3 changes: 0 additions & 3 deletions samples/snippets/quickstart_test.py
Expand Up @@ -14,9 +14,6 @@

import os

import google.cloud.dlp
import mock

import quickstart


Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/redact.py
Expand Up @@ -142,7 +142,7 @@ def redact_image_all_text(

# Construct the image_redaction_configs, indicating to DLP that all text in
# the input image should be redacted.
image_redaction_configs = [{"redact_all_text": True,}]
image_redaction_configs = [{"redact_all_text": True}]

# Construct the byte_item, containing the file's byte data.
with open(filename, mode="rb") as f:
Expand Down
1 change: 0 additions & 1 deletion samples/snippets/templates.py
Expand Up @@ -18,7 +18,6 @@

import argparse
import os
import time


# [START dlp_create_template]
Expand Down
1 change: 0 additions & 1 deletion samples/snippets/triggers.py
Expand Up @@ -18,7 +18,6 @@

import argparse
import os
import time


# [START dlp_create_trigger]
Expand Down

0 comments on commit 8b5b398

Please sign in to comment.