Skip to content

Commit 81a2971

Browse files
authored
Merge pull request #208 from CodeForPhilly/add-phone-matching
add mobile to matching
2 parents dd6fbce + 0cb3379 commit 81a2971

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/server/pipeline/match_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def start(connection, added_or_updated_rows):
2424
items_to_update["matching_id"] = 0 # initializing an int and overwrite in the loop
2525
items_to_update["archived_date"] = np.nan
2626
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
2927

3028
rows = items_to_update.to_dict(orient="records")
3129
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):
3937
row_matches = pdp_contacts[
4038
(pdp_contacts["first_name"] == row["first_name"]) &
4139
(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"]))
4341
]
4442
if row_matches.empty: # new record, no matching rows
4543
max_matching_group += 1

0 commit comments

Comments
 (0)