Two py2neo Exceptions...

8 views
Skip to first unread message

Alan Robertson

unread,
Sep 4, 2015, 8:38:45 PM9/4/15
to Neo4J, Nigel Small, David Fauth
I ran across two similar problems with the write_node() function in the py2neo code. The problem seems to be that the code makes too many assumptions about the node its been given to format.

I made an issue for it here:
    https://github.com/nigelsmall/py2neo/issues/434
and a pull request for the patch I created here:
    https://github.com/nigelsmall/py2neo/pull/433

My code creates nodes using the legacy.batch() code.

Here's the first exception:
Traceback (most recent call last):
File "./query.py", line 602, in 
qstore.commit()
File "/home/alanr/monitor/src/cma/store.py", line 999, in commit
self.batch_construct_relate_nodes() # These return new relationships
File "/home/alanr/monitor/src/cma/store.py", line 877, in batch_construct_relate_nodes
print >> sys.stderr, ('==== Performing batch.create(%s): node relationships' % absrel)
File "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 2475, in __str

return xstr(self.unicode())
File "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 2484, in unicode
writer.write_relationship(self)
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/lang.py", line 184, in write_relationship
self.write_node(relationship.start_node)
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/lang.py", line 150, in write_node
for label in sorted(node.labels):
AttributeError: 'NodePointer' object has no attribute 'labels'

Here's the second exception:

File "./query.py", line 602, in 
qstore.commit()
File "/home/alanr/monitor/src/cma/store.py", line 999, in commit
self.batch_construct_relate_nodes() # These return new relationships
File "/home/alanr/monitor/src/cma/store.py", line 877, in batch_construct_relate_nodes
print >> sys.stderr, ('==== Performing batch.create(%s): node relationships' % absrel)
File "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 2475, in __str

return xstr(self.unicode())
File "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 2484, in unicode
writer.write_relationship(self)
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/lang.py", line 185, in write_relationship
self.write_node(relationship.start_node)
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/lang.py", line 154, in write_node
if node.properties:
AttributeError: 'NodePointer' object has no attribute 'properties'


--

Alan Robertson / CTO
Al...@AssimilationSystems.com / +1 303.947.7999

Assimilation Systems Limited
http://AssimilationSystems.com

Twitter Linkedin skype

Reply all
Reply to author
Forward
0 new messages