Closed nrajasek1 closed 3 years ago
below are changes made to code to get it working
with read_con.cursor() as read_cur: read_cur.execute(DONOR_SELECT) read_cur.rowfactory = makeDictFactory(read_cur) # added to convert the records to dict full_data = [(row["DONOR_ID"], row) for row in read_cur] #changed from { to [ for outside braces
b_data = deduper.fingerprinter(full_data)
#print(list(b_data))
with write_con.cursor() as write_cur:
write_cur.executemany("INSERT INTO blocking_map VALUES (%s, %s)",
list(b_data)) #added list befoe b_data
when i ran mysql_example.py (only change is instead of mysql using oracle rest all the code is same no change) it is giving following error after
blocking... creating blocking_map database creating inverted index writing blocking map <generator object at 0x000000A4962E6EB0>
Traceback (most recent call last):
File "C:\Persistance ID\dedupe-examples-master\dedupe-examples-master\mysql_example\mysql_example.py", line 244, in
write_cur.executemany("INSERT INTO blocking_map VALUES (%s, %s)",
TypeError: parameters should be a list of sequences/dictionaries or an integer specifying the number of times to execute the statement