Skip to content

Commit 5dcc7b9

Browse files
authored
Merge pull request #6 from google/develop
Merge develop
2 parents d91efe9 + c8d8b6b commit 5dcc7b9

File tree

4 files changed

+5
-66
lines changed

4 files changed

+5
-66
lines changed

megalist_dataflow/README.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

megalist_dataflow/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def expand(self, executions):
7474
return (
7575
executions
7676
| 'Load Data - Google Ads Customer Match Mobile Device Id' >> BatchesFromExecutions(DestinationType.ADS_CUSTOMER_MATCH_MOBILE_DEVICE_ID_UPLOAD)
77+
| 'Hash Users - Google Ads Customer Match Contact Info' >> beam.Map(self._hasher.hash_users)
7778
| 'Upload - Google Ads Customer Match Mobile Device Id' >> beam.ParDo(
7879
GoogleAdsCustomerMatchMobileUploaderDoFn(self._oauth_credentials, self._dataflow_options.developer_token))
7980
)
@@ -95,6 +96,7 @@ def expand(self, executions):
9596
return (
9697
executions
9798
| 'Load Data - Google Ads Customer Match User Id' >> BatchesFromExecutions(DestinationType.ADS_CUSTOMER_MATCH_USER_ID_UPLOAD)
99+
| 'Hash Users - Google Ads Customer Match Contact Info' >> beam.Map(self._hasher.hash_users)
98100
| 'Upload - Google Ads Customer User Device Id' >> beam.ParDo(
99101
GoogleAdsCustomerMatchUserIdUploaderDoFn(self._oauth_credentials, self._dataflow_options.developer_token))
100102
)

megalist_dataflow/mappers/ads_user_list_pii_hashing_mapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _hash_user(self, user, hasher):
7979

8080
try:
8181
if 'user_id' in user:
82-
hashed['userId'] = user['user_id']
82+
hashed['userId'] = hasher.hash_field(user['user_id'])
8383
del hashed['user_id']
8484
except:
8585
self.logger.error("Error hashing user_id for user: %s" % user)

megalist_dataflow/uploaders/google_ads/customer_match/abstract_uploader.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,16 @@ def process(self, batch: Batch, **kwargs) -> None:
114114

115115
rows = self.get_filtered_rows(
116116
batch.elements, self.get_row_keys())
117-
logging.getLogger(_DEFAULT_LOGGER).warning(
118-
'Uploading %d rows to Google Ads', len(rows))
117+
119118
mutate_members_operation = {
120119
'operand': {
121120
'userListId': list_id,
122121
'membersList': rows
123122
},
124123
'operator': execution.destination.destination_metadata[1]
125124
}
125+
126126
utils.safe_call_api(self.call_api, logging, user_list_service, [mutate_members_operation])
127-
logging.getLogger(_DEFAULT_LOGGER).warning(
128-
'Uploaded %d rows to Google Ads', len(rows))
129127

130128
def call_api(self, service, operations):
131129
service.mutateMembers(operations)

0 commit comments

Comments
 (0)