File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ def start(connection, added_or_updated_rows):
24
24
items_to_update ["matching_id" ] = 0 # initializing an int and overwrite in the loop
25
25
items_to_update ["archived_date" ] = np .nan
26
26
items_to_update ["created_date" ] = datetime .datetime .now ()
27
- if "_id" in items_to_update .columns :
28
- del row ["_id" ] # avoid specifying the _id field, so postgres will auto-increment for us
29
27
30
28
rows = items_to_update .to_dict (orient = "records" )
31
29
row_print_freq = max (1 , np .floor_divide (len (rows ), 20 )) # approx every 5% (or every row if small)
@@ -39,7 +37,7 @@ def start(connection, added_or_updated_rows):
39
37
row_matches = pdp_contacts [
40
38
(pdp_contacts ["first_name" ] == row ["first_name" ]) &
41
39
(pdp_contacts ["last_name" ] == row ["last_name" ]) &
42
- (pdp_contacts ["email" ] == row ["email" ]) # TODO: could transform this line into an "or" with phone number
40
+ (( pdp_contacts ["email" ] == row ["email" ]) | ( pdp_contacts [ "mobile" ] == row [ "mobile" ]))
43
41
]
44
42
if row_matches .empty : # new record, no matching rows
45
43
max_matching_group += 1
You can’t perform that action at this time.
0 commit comments