@@ -928,7 +928,7 @@ def deidentify_with_time_extract(
928
928
input_csv_file : str ,
929
929
output_csv_file : str ,
930
930
) -> None :
931
- """ Uses the Data Loss Prevention API to deidentify dates in a CSV file through
931
+ """Uses the Data Loss Prevention API to deidentify dates in a CSV file through
932
932
time part extraction.
933
933
Args:
934
934
project: The Google Cloud project id to use as a parent resource.
@@ -968,9 +968,7 @@ def map_data(value):
968
968
try :
969
969
date = datetime .strptime (value , "%m/%d/%Y" )
970
970
return {
971
- "date_value" : {
972
- "year" : date .year , "month" : date .month , "day" : date .day
973
- }
971
+ "date_value" : {"year" : date .year , "month" : date .month , "day" : date .day }
974
972
}
975
973
except ValueError :
976
974
return {"string_value" : value }
@@ -995,9 +993,7 @@ def map_rows(row):
995
993
"field_transformations" : [
996
994
{
997
995
"primitive_transformation" : {
998
- "time_part_config" : {
999
- "part_to_extract" : "YEAR"
1000
- }
996
+ "time_part_config" : {"part_to_extract" : "YEAR" }
1001
997
},
1002
998
"fields" : date_fields ,
1003
999
}
@@ -2266,14 +2262,14 @@ def deidentify_table_with_multiple_crypto_hash(
2266
2262
time_extract_parser .add_argument (
2267
2263
"input_csv_file" ,
2268
2264
help = "The path to the CSV file to deidentify. The first row of the "
2269
- "file must specify column names, and all other rows must contain "
2270
- "valid values." ,
2265
+ "file must specify column names, and all other rows must contain "
2266
+ "valid values." ,
2271
2267
)
2272
2268
time_extract_parser .add_argument (
2273
2269
"date_fields" ,
2274
2270
nargs = "+" ,
2275
2271
help = "The list of date fields in the CSV file to de-identify. Example: "
2276
- "['birth_date', 'register_date']" ,
2272
+ "['birth_date', 'register_date']" ,
2277
2273
)
2278
2274
time_extract_parser .add_argument (
2279
2275
"output_csv_file" , help = "The path to save the time-extracted data."
0 commit comments