question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'PTNCPredicate' object has no attribute 'tag'

See original GitHub issue

Hello!

I followed the Big Postgres example and sometimes after I have finished a training, and go to do a static dedupe with my generated settings file, I get this error:

blocking...
creating blocking_map database
creating inverted index
ERROR:flask.app:Exception on /individual [GET]
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/app/app.py", line 277, in individual
deduper.blocker.index(field_data, field)
File "/app/.heroku/python/lib/python3.6/site-packages/dedupe/blocking.py", line 66, in index
index.index(preprocess(doc))
File "/app/.heroku/python/lib/python3.6/site-packages/parseratorvariable/predicates.py", line 13, in preprocess
tags, _ = self.tag(doc)
AttributeError: 'PTNCPredicate' object has no attribute 'tag'

It looks like it is happening at line 179 in the example, which my code is identical to, except I have moved it into a flask app that uses celery (unsure if that is relevant).

I seem to get this error intermittently, and I’m not sure what is causing it. I am also a new to python development, so the error wording may make sense to someone more familiar with the language. Does anyone know why I could be getting this error?

I am using dedupe version 1.9.2 and python version 3.6.5

Edit: In case this helps, after more testing I have noticed that this only happens after I have completed a training, run a static dedupe, and then go to train data again. I can get through the training the second time, but when I try to use the settings file I generated, the above error is produced. If I restart the process, then I can complete another training and use that settings file successfully.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fgreggcommented, Sep 13, 2018

I fixed this problem.

1reaction
gavingcommented, Sep 13, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

'ElementTree' object has no attribute 'tag' in Python - Stack ...
I want to parse an XML file and extract the nodes that I am interested in if the nodes contain a specific string...
Read more >
AttributeError: 'Unicode' object has no attribute 'tag' in Python2 ...
I have both Python 2.7.12 and Python 3.5.1 on Fedora24, ... AttributeError: 'Unicode' object has no attribute 'tag' in Python2 #1011.
Read more >
AttributeError: 'MultivariateSample' object has no attribute 'train'
While running the python code that is available in the linkclient-libraries-multivariate , i got the below error in "Run the Application" area.
Read more >
Attribute Error in Component Custom Method - Ignition
AttributeError : 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'tag'. I don't get it…I thought custom method ...
Read more >
Django: AttributeError: 'str' object has no attribute 'resolve'
Django: AttributeError: 'str' object has no attribute 'resolve'. Here is today's obscure error message and its solution. Say you are working on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found