You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use of batch create_or_update for a bunch of StructuredNode Objects
Expected behaviour
Neo4j populated
Actual behaviour
Exception occurs:
Traceback (most recent call last):
File "/Users/myUser/git-python/neo4j-lab01/src/myfolder/PopulateNeo4jFromHeliosDevGithub.py", line 49, in
Person.create_or_update(listPersons)
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/core.py", line 509, in create_or_update
for specified, deflated in [
^
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/core.py", line 510, in
(p, cls.deflate(p, skip_empty=True)) for p in props
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/properties.py", line 92, in deflate
if properties.get(name) is not None:
^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
Steps to reproduce
Datamodel :
from neomodel import StructuredNode, StringProperty, RelationshipTo, RelationshipFrom, StructuredRel, DateProperty
class Dog(StructuredNode):
name = StringProperty(required=True)
owner = RelationshipTo('Person', 'owner')
class Person(StructuredNode):
name = StringProperty(unique_index=True)
pets = RelationshipFrom('Dog', 'owner')
Code :
with db.transaction:
###### This code is working fine
people = Person.create_or_update(
{'name': 'Tim', 'age': 83},
{'name': 'Bob', 'age': 23},
{'name': 'Jill', 'age': 34},
)
######
###### The code hereunder does raise Exception above
listPersons = []
listPersons.append(Person(name= 'Susan'))
listPersons.append(Person(name='Bob'))
Person.create_or_update(listPersons)
Additional info:
Output of the commands:
python --version
pip show connexion | grep "^Version\:"
The text was updated successfully, but these errors were encountered:
Description
Use of batch create_or_update for a bunch of StructuredNode Objects
Expected behaviour
Neo4j populated
Actual behaviour
Exception occurs:
Traceback (most recent call last):
File "/Users/myUser/git-python/neo4j-lab01/src/myfolder/PopulateNeo4jFromHeliosDevGithub.py", line 49, in
Person.create_or_update(listPersons)
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/core.py", line 509, in create_or_update
for specified, deflated in [
^
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/core.py", line 510, in
(p, cls.deflate(p, skip_empty=True)) for p in props
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/neomodel/properties.py", line 92, in deflate
if properties.get(name) is not None:
^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
Steps to reproduce
Datamodel :
from neomodel import StructuredNode, StringProperty, RelationshipTo, RelationshipFrom, StructuredRel, DateProperty
class Dog(StructuredNode):
name = StringProperty(required=True)
owner = RelationshipTo('Person', 'owner')
class Person(StructuredNode):
name = StringProperty(unique_index=True)
pets = RelationshipFrom('Dog', 'owner')
Code :
with db.transaction:
Additional info:
Output of the commands:
python --version
pip show connexion | grep "^Version\:"
The text was updated successfully, but these errors were encountered: