Skip to content

Commit 6794993

Browse files
authored
Fix bug in add_customer_match_user_list example. (#515)
1 parent a8cde01 commit 6794993

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

examples/remarketing/add_customer_match_user_list.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,8 @@ def _add_users_to_customer_match_user_list(
117117
)
118118

119119
# Issues a request to create an offline user data job.
120-
create_offline_user_data_job_response = (
121-
offline_user_data_job_service_client.create_offline_user_data_job(
122-
customer_id=customer_id, job=offline_user_data_job
123-
)
120+
create_offline_user_data_job_response = offline_user_data_job_service_client.create_offline_user_data_job(
121+
customer_id=customer_id, job=offline_user_data_job
124122
)
125123
offline_user_data_job_resource_name = (
126124
create_offline_user_data_job_response.resource_name
@@ -153,7 +151,9 @@ def _add_users_to_customer_match_user_list(
153151
# Retrieve the class definition of the GoogleAdsFailure instance
154152
# in order to use the "deserialize" class method to parse the
155153
# error_detail string into a protobuf message object.
156-
failure_object = type(failure_message).deserialize(error_detail)
154+
failure_object = type(failure_message).deserialize(
155+
error_detail.value
156+
)
157157

158158
for error in failure_object.errors:
159159
print(
@@ -167,10 +167,8 @@ def _add_users_to_customer_match_user_list(
167167

168168
# Issues an request to run the offline user data job for executing all
169169
# added operations.
170-
operation_response = (
171-
offline_user_data_job_service_client.run_offline_user_data_job(
172-
resource_name=offline_user_data_job_resource_name
173-
)
170+
operation_response = offline_user_data_job_service_client.run_offline_user_data_job(
171+
resource_name=offline_user_data_job_resource_name
174172
)
175173

176174
if skip_polling:
@@ -222,11 +220,11 @@ def _build_offline_user_data_job_operations(client):
222220
)
223221
user_identifier_with_address = client.get_type("UserIdentifier")
224222
# First and last name must be normalized and hashed.
225-
user_identifier_with_address.address_info.hashed_first_name = (
226-
_normalize_and_hash("John")
223+
user_identifier_with_address.address_info.hashed_first_name = _normalize_and_hash(
224+
"John"
227225
)
228-
user_identifier_with_address.address_info.hashed_last_name = (
229-
_normalize_and_hash("Doe")
226+
user_identifier_with_address.address_info.hashed_last_name = _normalize_and_hash(
227+
"Doe"
230228
)
231229
# Country and zip codes are sent in plain text.
232230
user_identifier_with_address.address_info.country_code = "US"

0 commit comments

Comments
 (0)