@@ -15,13 +15,14 @@ def normalize_before_match(value):
15
15
return result
16
16
17
17
18
- def start (connection , added_or_updated_rows ):
18
+ def start (connection , added_or_updated_rows , manual_matches_df ):
19
19
# Match new records to each other and existing pdp_contacts data.
20
20
# Assigns matching ID's to records, as well.
21
21
# WARNING: not thread-safe and could lead to concurrency issues if two users /execute simultaneously
22
22
current_app .logger .info ('Start record matching' )
23
23
# Will need to consider updating the existing row contents (filter by active), deactivate,
24
24
# try to match, and merge previous matching groups if applicable
25
+ current_app .logger .info ('Manual matches DF: ' + manual_matches_df )
25
26
26
27
job_id = str (int (time .time ()))
27
28
log_db .log_exec_status (job_id , {'status' : 'starting' , 'at_row' : 0 , 'of_rows' : 0 })
@@ -63,13 +64,13 @@ def start(connection, added_or_updated_rows):
63
64
# Exact matches based on specified columns
64
65
row_matches = pdp_contacts [
65
66
(
66
- ((pdp_contacts ["first_name_normalized" ] == row ["first_name_normalized" ]) &
67
- (pdp_contacts ["last_name_normalized" ] == row ["last_name_normalized" ]))
68
- |
69
- ((pdp_contacts ["first_name_normalized" ] == row ["last_name_normalized" ]) &
70
- (pdp_contacts ["last_name_normalized" ] == row ["first_name_normalized" ]))
71
- &
72
- ((pdp_contacts ["email_normalized" ] == row ["email_normalized" ]) | (pdp_contacts ["mobile" ] == row ["mobile" ]))
67
+ ((pdp_contacts ["first_name_normalized" ] == row ["first_name_normalized" ]) &
68
+ (pdp_contacts ["last_name_normalized" ] == row ["last_name_normalized" ]))
69
+ |
70
+ ((pdp_contacts ["first_name_normalized" ] == row ["last_name_normalized" ]) &
71
+ (pdp_contacts ["last_name_normalized" ] == row ["first_name_normalized" ]))
72
+ &
73
+ ((pdp_contacts ["email_normalized" ] == row ["email_normalized" ]) | (pdp_contacts ["mobile" ] == row ["mobile" ]))
73
74
)
74
75
]
75
76
if row_matches .empty : # new record, no matching rows
0 commit comments