@@ -22,8 +22,6 @@ def start(connection, added_or_updated_rows, manual_matches_df):
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 )
26
-
27
25
job_id = str (int (time .time ()))
28
26
log_db .log_exec_status (job_id , {'status' : 'starting' , 'at_row' : 0 , 'of_rows' : 0 })
29
27
current_app .logger .info ("***** Running execute job ID " + job_id + " *****" )
@@ -73,6 +71,13 @@ def start(connection, added_or_updated_rows, manual_matches_df):
73
71
((pdp_contacts ["email_normalized" ] == row ["email_normalized" ]) | (pdp_contacts ["mobile" ] == row ["mobile" ]))
74
72
)
75
73
]
74
+ #collect other linked ids from manual matches source
75
+ linked_ids = manual_matches_df [(manual_matches_df [row ["source_type" ]] == row ["source_id" ])]
76
+ ids = linked_ids .to_dict (orient = "records" )
77
+ for id_num , row_dict in enumerate (ids ):
78
+ for column , value in row_dict .items ():
79
+ row_matches = row_matches .append (pdp_contacts [(pdp_contacts ["source_type" ] == column ) & (pdp_contacts ["source_id" ] == value )])
80
+
76
81
if row_matches .empty : # new record, no matching rows
77
82
max_matching_group += 1
78
83
row_group = max_matching_group
0 commit comments