I have the following code:
for t in set(tags):
new_tag = Node('Tag', name=t)
tag = graph.merge(new_tag, 'Tag', 'name')
rel = Relationship(tag, 'TAGGED', post)
graph.create(rel)
The problem is that graph.merge()
is returning None
, but documentation says it would crate a new node if no matches are found.
This is the error I get when graph.create(rel)
is executed:
File "/Users/hugovillalobos/Documents/Code/FlaskrGraphProject/FlaskrGraphVenv/lib/python3.7/site-packages/py2neo/internal/operations.py", line 134, in <genexpr>
for labels, nodes in _node_create_dict(n for n in subgraph.nodes if n.graph is None).items():
AttributeError: 'NoneType' object has no attribute 'graph'