AttributeError: 'NoneType' object has no attribute '_doc_to_id'
Team, We are facing this error while using markPairs method File "C:\Users\Python3\lib\site-packages\dedupe\predicates.py", line 147, in call doc_id = self.index._doc_to_id[doc] AttributeError: 'NoneType' object has no attribute '_doc_to_id'
Also, I couldn't find any code piece in which self.index is initialized to some other value other than None in predicates.py
Please guide me, if I am missing anything
@fgregg
Hi I had the same issue. I met it when I readTraining file. And it only happens recently. I believe previously I successfully readTraining without getting this error. Did you make any changes in the source code?
@Sushant20 Yes, from what I see from the code, this regression was introduced when merging the #720 pull request into master. In the meantime, I guess our only solution is to revert to using version 1.9.6. Regarding the point where the 'index' attribute of a Predicate instance is set to something else than 'None', it is in the 'blocking.py' module (and can also be set to an 'initialized index' somewhere in the 'api.py' module).
Hi! I had the same issue too. And solved it by revert to using version 1.9.6.
Could someone please post code that would allow me to reproduce this error.
and a full traceback
You can reproduce the error by taking your csv_example and simply changing line 110 of csv_example.py from:
deduper.sample(data_d, 15000)
to:
deduper.sample(data_d, 300)
Then, run it twice, deleting the csv_example_learned_settings file between the two runs. On the second run, you'll receive an error. Attached is the traceback I got from doing this.
traceback.txt
I used release 1.9.7.
started on a fix in #761, if you'd like to check that out.
fixed by #761. new version of dedupe on pypi.