We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For bound nodes with identity=0, hash computation should be based on the graph.service, graph.name and identity attributes.
identity=0
graph.service
graph.name
identity
If identity=0 for a bound node, then the if statement on line 691 is equivalent to the snippet below and always evaluates to False:
if
False
if self.graph and 0: ...
which means that the hash is computed based on the Python object's identity.
You would need a fresh Neo4j instance, or to query a node with <id>: 0, or to set node's identity to 0 manually:
<id>: 0
from py2neo import Graph, Node g = Graph() n = Node() g.create(n) # node is bound now n.identity = 0 # re-write identity for demonstration h = hash(n) h_unbound = hash(id(n)) print(h == h_unbound) h_bound = hash(n.graph.service) ^ hash(n.graph.name) ^ hash(n.identity) print(h == h_bound)
Replace the line 691 with
if self.graph and (self.identity is not None): ...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Expected behavior
For bound nodes with
identity=0
, hash computation should be based on thegraph.service
,graph.name
andidentity
attributes.Actual behavior
If
identity=0
for a bound node, then theif
statement on line 691 is equivalent to the snippet below and always evaluates toFalse
:which means that the hash is computed based on the Python object's identity.
Steps to reproduce the problem
You would need a fresh Neo4j instance, or to query a node with
<id>: 0
, or to set node'sidentity
to 0 manually:Proposed solution
Replace the line 691 with
The text was updated successfully, but these errors were encountered: