Open g3rd opened 7 years ago
Updated the Execute Query section to include the transaction.
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
:
with graph.transaction(commit=False) as tx:
results = graph.query(q, returns=(RAW, client.Node, ))
Or even create your own casting function:
with graph.transaction(commit=False) as tx:
results = graph.query(q,
returns=(lambda x: graph.node(x["self"]) if x and "self" in x else None,
client.Node, ))
Let me know if any of this approaches work.
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: