Using field type Set with tuple values generates TypeError in "canonical.py" getCentroid
Believe this to be a bug, but it's possible I'm not understanding the functionality...
Working from the csv_example.py script with some minor modifications.
Comparing fields as follows, note Set for phones:
fields = [
{'field': 'first_name', 'type': 'String'},
{'field': 'middle_name', 'type': 'String'},
{'field': 'last_name', 'type': 'String'},
{'field': 'name_normalized', 'type': 'String'},
{'field': 'address_string', 'type': 'Address'},
{'field': 'phones', 'type': 'Set'}
]
dedupe.canonicalize parses other values but fails upon reaching the tuple of phone numbers in the format of:
(('2225551234',), ('2225554321,))
Traceback (most recent call last):
File "/Users/foo/Documents/github/dedupe/main.py", line 187, in <module>
canonical_rep = dedupe.canonicalize(cluster_d)
File "/Users/foo/.local/share/virtualenvs/dedupe-rNl1qbU5/lib/python2.7/site-packages/dedupe/convenience.py", line 238, in canonicalize
return getCanonicalRep(record_cluster)
File "/Users/foo/.local/share/virtualenvs/dedupe-rNl1qbU5/lib/python2.7/site-packages/dedupe/canonical.py", line 67, in getCanonicalRep
canonical_rep[key] = getCentroid(key_values, comparator)
File "/Users/foo/.local/share/virtualenvs/dedupe-rNl1qbU5/lib/python2.7/site-packages/dedupe/canonical.py", line 19, in getCentroid
distance = comparator(attribute_variants[i], attribute_variants[j])
TypeError: Argument 'string1' has incorrect type (expected basestring, got tuple)
Right now canonicalize can only handle string input, dupe of #593 and #274