neo4j / neo4j-python-driver

Neo4j Bolt driver for Python
https://neo4j.com/docs/api/python-driver/current/
Other
898 stars 186 forks source link

OverflowError #922

Closed squirrelfish closed 1 year ago

squirrelfish commented 1 year ago

Bug Report

run tx.run("MERGE (a:Person {id: $id}) ", id=10000000000000) get OverflowError: Integer 10000000000000 out of range

My Environment

Python Version: 3.11.2 Driver Version: 5.6.0 Server Version and Edition: 5.6.0 community Operating System: Windows 10

robsdedude commented 1 year ago

Hi and thanks for reaching out. This is a limitation of the DBMS (and is also reflected by the protocol). If you look here https://neo4j.com/docs/api/python-driver/current/api.html#core-data-types you'll see that the DBMS is using long to store integers. So this limits all integers going through neo4j to be in the range -2147483648 <= x <= 2147483647

I'll close this issue as it's not a bug. But please feel free to keep commenting if you have further questions.

EDIT: My bad, java's long is 64 bits. So the range is actually -9223372036854775808 == -(2**63) <= x <= 2**63-1 == 9223372036854775807. With that being said, I can't reproduce the OverflowError with the query tx.run("MERGE (a:Person {id: $id}) ", id=10000000000000) you posted.