Skip to content

Commit 7fdebf7

Browse files
averikitschandrewsg
authored andcommitted
updated DLP quickstart terminal print out and tests (#1413)
1 parent a615cb0 commit 7fdebf7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dlp/quickstart.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ def quickstart():
7272
except AttributeError:
7373
pass
7474
print('Info type: {}'.format(finding.info_type.name))
75-
print('Likelihood: {}'.format(finding.likelihood))
75+
# Convert likelihood value to string respresentation.
76+
likelihood = (google.cloud.dlp.types.Finding.DESCRIPTOR
77+
.fields_by_name['likelihood']
78+
.enum_type.values_by_number[finding.likelihood]
79+
.name)
80+
print('Likelihood: {}'.format(likelihood))
7681
else:
7782
print('No findings.')
7883
# [END quickstart]

0 commit comments

Comments
 (0)