Skip to content

Commit 8f708fe

Browse files
committed
Added 4.2 support
1 parent 9ddae6c commit 8f708fe

13 files changed

+280
-12
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Neo4j Driver Change Log
22

3+
## Version 4.2
4+
5+
- No driver changes have been made for Neo4j 4.2
6+
7+
8+
## Version 4.1
9+
10+
- Routing context is now forwarded to the server for when required by server-side routing
11+
12+
313
## Version 4.0 - Breaking Changes
414

515
- The package version has jumped from `1.7` directly to `4.0`, in order to bring the version in line with Neo4j itself.

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ See, https://neo4j.com/docs/migration-guide/4.0/upgrade-driver/#upgrade-driver-b
7575
See, https://neo4j.com/docs/driver-manual/current/client-applications/#driver-connection-uris for changes in default security settings between 3.x and 4.x
7676

7777

78-
Connecting with Python Driver 4.1 against Neo4j 3.5
79-
---------------------------------------------------
78+
Connecting with Python Driver 4.x to Neo4j 3.5
79+
----------------------------------------------
8080

81-
Using the Python Driver 4.1 and connecting to Neo4j 3.5 with default connection settings for Neo4j 3.5.
81+
Using the Python Driver 4.x and connecting to Neo4j 3.5 with default connection settings for Neo4j 3.5.
8282

8383
.. code-block:: python
8484
@@ -91,10 +91,10 @@ Using the Python Driver 4.1 and connecting to Neo4j 3.5 with default connection
9191
driver = GraphDatabase.driver("neo4j://localhost:7687", auth=("neo4j", "password"), encrypted=True, trust=False)
9292
9393
94-
Connecting with Python Driver 1.7 against Neo4j 4.1
95-
---------------------------------------------------
94+
Connecting with Python Driver 1.7 to Neo4j 4.x
95+
----------------------------------------------
9696

97-
Using the Python Driver 1.7 and connecting to Neo4j 4.1 with default connection settings for Neo4j 4.1.
97+
Using the Python Driver 1.7 and connecting to Neo4j 4.x with default connection settings for Neo4j 4.x.
9898

9999
.. code-block:: python
100100

neo4j/io/_bolt3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
class Bolt3(Bolt):
6666
""" Protocol handler for Bolt 3.
6767
68-
This is supported by Neo4j versions 3.5, 4.0 and 4.1.
68+
This is supported by Neo4j versions 3.5, 4.0, 4.1 and 4.2.
6969
"""
7070

7171
PROTOCOL_VERSION = Version(3, 0)

neo4j/io/_bolt4.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
class Bolt4x0(Bolt):
6666
""" Protocol handler for Bolt 4.0.
6767
68-
This is supported by Neo4j versions 4.0 and 4.1.
68+
This is supported by Neo4j versions 4.0, 4.1 and 4.2.
6969
"""
7070

7171
PROTOCOL_VERSION = Version(4, 0)
@@ -370,7 +370,8 @@ def fetch_message(self):
370370
self.pool.on_write_failure(address=self.unresolved_address),
371371
raise
372372
else:
373-
raise BoltProtocolError("Unexpected response message with signature %02X" % summary_signature, self.unresolved_address)
373+
raise BoltProtocolError("Unexpected response message with signature "
374+
"%02X" % ord(summary_signature), self.unresolved_address)
374375

375376
return len(details), 1
376377

@@ -459,7 +460,7 @@ def defunct(self):
459460
class Bolt4x1(Bolt4x0):
460461
""" Protocol handler for Bolt 4.1.
461462
462-
This is supported by Neo4j version 4.1.
463+
This is supported by Neo4j versions 4.1 and 4.2.
463464
"""
464465

465466
PROTOCOL_VERSION = Version(4, 1)
@@ -474,3 +475,12 @@ def get_base_headers(self):
474475
"user_agent": self.user_agent,
475476
"routing": self.routing_context,
476477
}
478+
479+
480+
class Bolt4x2(Bolt4x1):
481+
""" Protocol handler for Bolt 4.2.
482+
483+
This is supported by Neo4j version 4.2.
484+
"""
485+
486+
PROTOCOL_VERSION = Version(4, 2)

neo4j/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# Can be automatically overridden in builds
2323
package = "neo4j"
24-
version = "4.1.dev0"
24+
version = "4.2.dev0"
2525

2626

2727
def get_user_agent():
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!: BOLT 4.2
2+
!: PORT 9001
3+
4+
C: HELLO {"user_agent": "test", "scheme": "basic", "principal": "test", "credentials": "test", "routing": {"address": "localhost:9001"}}
5+
S: SUCCESS {"server": "Neo4j/4.2.0", "connection_id": "123e4567-e89b-12d3-a456-426655440000"}
6+
C: GOODBYE
7+
S: <EXIT>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
!: BOLT 4.2
2+
!: AUTO GOODBYE
3+
!: AUTO RESET
4+
!: PORT 9002
5+
6+
C: HELLO {"scheme": "basic", "principal": "test", "credentials": "test", "user_agent": "test", "routing": {"address": "localhost:9001", "policy": "my_policy", "region": "china"}}
7+
S: SUCCESS {"server": "Neo4j/4.2.0", "connection_id": "bolt-123456789"}
8+
C: RUN "RETURN 1 AS x" {} {"mode": "r"}
9+
PULL {"n": -1}
10+
S: SUCCESS {"fields": ["x"]}
11+
RECORD [1]
12+
SUCCESS {"bookmark": "neo4j:bookmark-test-2", "type": "r", "t_last": 5, "db": "system"}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
!: BOLT 4.2
2+
!: AUTO GOODBYE
3+
!: AUTO RESET
4+
!: PORT 9001
5+
6+
C: HELLO {"user_agent": "test", "scheme": "basic", "principal": "test", "credentials": "test", "routing": {"address": "localhost:9001"}}
7+
S: SUCCESS {"server": "Neo4j/4.2.0", "connection_id": "123e4567-e89b-12d3-a456-426655440000"}
8+
C: RUN "RETURN 1 AS x" {} {"mode": "r"}
9+
PULL {"n": 2}
10+
S: SUCCESS {"fields": ["x"]}
11+
<NOOP>
12+
<NOOP>
13+
RECORD [1]
14+
<NOOP>
15+
SUCCESS {"bookmark": "neo4j:bookmark-test-1", "type": "r", "t_last": 5, "db": "neo4j"}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
!: BOLT 4.2
2+
!: PORT 9001
3+
4+
C: HELLO {"user_agent": "test", "scheme": "basic", "principal": "test", "credentials": "test", "routing": {"address": "localhost:9001"}}
5+
S: SUCCESS {"server": "Bogus/4.2.0", "connection_id": "123e4567-e89b-12d3-a456-426655440000"}
6+
C: RUN "RETURN 1 AS x" {} {"mode": "r"}
7+
PULL {"n": -1}
8+
S: SUCCESS {"fields": ["x"]}
9+
RECORD [1]
10+
SUCCESS {"bookmark": "neo4j:bookmark-test-1", "type": "r", "t_last": 5, "db": "neo4j"}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
!: BOLT 4.2
2+
!: AUTO GOODBYE
3+
!: AUTO RESET
4+
!: PORT 9001
5+
6+
C: HELLO {"scheme": "basic", "principal": "test", "credentials": "test", "user_agent": "test", "routing": {"address": "localhost:9001", "policy": "my_policy", "region": "china"}}
7+
S: SUCCESS {"server": "Neo4j/4.2.0", "connection_id": "bolt-123456789"}
8+
C: RUN "CALL dbms.routing.getRoutingTable($context)" {"context": {"address": "localhost:9001", "policy": "my_policy", "region": "china"}} {"mode": "r", "db": "system"}
9+
PULL {"n": -1}
10+
S: SUCCESS {"fields": ["ttl", "servers"]}
11+
RECORD [4321, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]]
12+
SUCCESS {"bookmark": "neo4j:bookmark-test-1", "type": "r", "t_last": 5, "db": "system"}

0 commit comments

Comments
 (0)