Skip to content

Commit 4748f3b

Browse files
remove quotation marks in names
1 parent 1a86dd4 commit 4748f3b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/server/pipeline/flow_script.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def start_flow():
6565
# components.
6666
# 6. Update each row in pdp_contacts to give it a match id
6767
# corresponding to its connected componenet.
68-
6968

7069
current_app.logger.info("Clearing pdp_contacts to prepare for match")
7170
reset_pdp_contacts_with_unmatched(conn)
@@ -113,9 +112,17 @@ def reset_pdp_contacts_with_unmatched(conn):
113112
conn.execute(Volgistics.insert_into_pdp_contacts())
114113
conn.execute(ShelterluvPeople.insert_into_pdp_contacts())
115114

116-
def compare_names(n1, n2):
115+
116+
def name_to_array(n):
117117
delims = text("'( and | & |, | )'")
118-
return func.regexp_split_to_array(func.lower(n1), delims).bool_op("&&")(func.regexp_split_to_array(func.lower(n2), delims))
118+
return func.regexp_split_to_array(
119+
func.lower(func.translate(n, text("'\"'"), text("''"))), delims
120+
)
121+
122+
123+
def compare_names(n1, n2):
124+
return name_to_array(n1).bool_op("&&")(name_to_array(n2))
125+
119126

120127
def get_automatic_matches(conn):
121128
pc1 = PdpContacts.__table__.alias()

0 commit comments

Comments
 (0)