Gds.run_cypher( *string_with_\\"_symbols* ) called in python behaving strange and different from calling same code in neo4j desktop

Hey everyone!

I faced a strange behavior

My code is complicated, it includes "call apoc..." query, query Inside of it, and one more level
So I have to use quotes construction like:

"
*main code, calling*

>       \"smth inside \"

"

when I run it neo4j desktop - it's fine (apoc.periodic.iterate returns 400 batches in 1 min approximately)
In python I copy exactly the same code, change

""

to

"\"

, execute it using gds.run_cypher("""my same code """) and the result I receive - nothing changed, 1 batch complete, 0 sec, 0 errors

Then I execute print(my same code), copy everything and execute again in Neo - and it's fine again

Why can this be happening?

I cannot pinpoint root cause for you, but have you tried a multiline string wrapper? This is what I typically do for cypher queries with embedded quotes:

cql = '''
*main code, calling*
"somthing inside"
'''

Then pass the cql variable as an input parameter to whatever query execution function you are using. I have not had issues with this boilerplate...yet.