0

I upgraded to py2neo 2.0 and the code I used for streaming and writing results to file doesn't work any more. The error I am getting is TypeError: 'CypherResource' object is not callable.

from py2neo import Graph
from py2neo.packages.httpstream import http
http.socket_timeout = 9999
graph = Graph()
query="""
MY QUERY
"""
result=graph.cypher(graph,query)
with open('myfile','w') as f:
    for record in result.stream():
        v=record.values

I assume the error is in graph.cypher(graph,query), but I was not successful in fixing the error.

user201411
  • 254
  • 2
  • 11

1 Answers1

0

You are using Graph.cypher incorrectly. This is an object with execution and transaction management methods, not a callable itself. Please read the docs at:

http://py2neo.org/2.0/cypher.html

Nigel Small
  • 4,475
  • 1
  • 17
  • 15