Skip to content

Write transaction hangs program when invalid value is passed as parameter without error #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjmare opened this issue Oct 26, 2017 · 3 comments
Assignees
Labels

Comments

@mjmare
Copy link

mjmare commented Oct 26, 2017

I have this function that is called in a write transaction:

from uuid import uuid4

:
    def add_technique(tx, title, topic):
        tx.run("MERGE (t:Technique {title: $title, uuid: $uuid}) "
               "MERGE (topic:Topic {name: $topic}) "
               "MERGE (t)-[:BELONGS_TO]->(topic)",
               topic=topic, title=title, uuid=uuid4())

:
    with driver.session() as session:
        for s in sections:
                session.write_transaction(add_technique, s['title'], s['topic'])
:

Please note that the third parameter uuid of the cypher statement is passed an incorrect type because uuid4() returns a uuid.UUID instance, not a string as I thought.
When running the program it hangs on the first call to tx.run. No exceptions or messages. The only option is to kill the program.
When the paramater value is corrected to str(uuid4()) everything is fine.

Using Neo4j community v3.2
Python driver 1.5.0
Python 3.6.3 on OSX

@zhenlineo
Copy link
Contributor

#200 fixes this issue and #199 add related tests for it.
These fixes will come in next patch release 1.5.2.

@zhenlineo
Copy link
Contributor

The new 1.5.2 driver has the fix for this bug :)

@mjmare
Copy link
Author

mjmare commented Dec 1, 2017

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants