neo4j-contrib / py2neo

EOL! Py2neo is a comprehensive Neo4j driver library and toolkit for Python.
https://py2neo.org
Apache License 2.0
20 stars 8 forks source link

Query error calling apoc #907

Closed jocon-grmtx closed 3 years ago

jocon-grmtx commented 3 years ago

Hello, I am getting an exception when trying to execute a query that invokes an apoc procedure. I can execute this just fine via neo desktop (with the parameters set exactly as they are in my code). The query is:

bim_g = graph.query("CALL apoc.path.expand($node_id, "", $target_path,1,4) YIELD path WITH path WHERE NOT ([n in nodes(path) WHERE n.count=0]) RETURN [x IN nodes(path) | x.key] AS keys", {"node_id": lnid, "target_path": tp})

Is there any particular reason why this would not work via py2neo? Thanks, JC

technige commented 3 years ago

You don't actually mention the actual error you are seeing. This should always be included in any issue.

However, you are embedding double quotes within a string delimited by double quotes, which would be a regular Python syntax error. I suggest you switch one of those sets of quotes to single quotes instead.

jocon-grmtx commented 3 years ago

Hi Nigel - thanks for the response. My bad not sending the error. I had to set to false 'just my code' in vs code to see it. But your instincts were right - it was the double quote inside the double quote. Thanks for a great library. John