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
MATCH (person:Person {id: 1})
OPTIONAL MATCH (person)-[:OWNS]->(product:Product)
RETURN person, product
Execute Query
with graph.transaction(commit=False) as tx:
results = graph.query(q, returns=(client.Node, client.Node, ))
Exception
If I execute the Query and it has the optional match, no exception. If the optional match returns None I get:
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 829, in __exit__
self.commit()
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 948, in commit
results = self._execute(url, results=True)
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 868, in _execute
_results = self._update(content["results"])
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 891, in _update
obj, elements=result["data"], returns=returns
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 792, in cast
casted_row.append(cast_element(element, func))
File "/usr/local/lib/python3.5/site-packages/neo4jrestclient/query.py", line 714, in cast_element
obj = func(element["self"], update_dict=element,
TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered:
It looks like I should check whether element is None before getting element["self"]. In the meantime you could try casting to neo4jrestclient.constants.RAW:
Query:
Execute Query
Exception
If I execute the Query and it has the optional match, no exception. If the optional match returns
None
I get:The text was updated successfully, but these errors were encountered: