Skip to content

Commit 3821bef

Browse files
committed
Fix imports and fix route to read
1 parent 7fdc231 commit 3821bef

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/source/integration.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ In this small example, we import a graph from a Neo4j query result.
183183

184184
.. code-block:: python
185185
186-
from neo4j import GraphDataScience
186+
from neo4j import GraphDatabase, RoutingControl, Result
187187
from neo4j_viz.gds import from_gds
188188
189189
# Modify this to match your Neo4j instance's URI and credentials
@@ -196,6 +196,7 @@ In this small example, we import a graph from a Neo4j query result.
196196
result = driver.execute_query(
197197
"MATCH (n)-[r]->(m) RETURN n,r,m",
198198
database_="neo4j",
199+
routing_=RoutingControl.READ,
199200
result_transformer_=Result.graph,
200201
)
201202

examples/neo4j-example.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
"source": [
4545
"import os\n",
4646
"\n",
47-
"from neo4j import GraphDatabase, Result\n",
48-
"\n",
4947
"URI = os.environ.get(\"NEO4J_URI\", \"bolt://localhost:7687\")\n",
5048
"\n",
5149
"auth = None\n",
@@ -68,6 +66,8 @@
6866
"metadata": {},
6967
"outputs": [],
7068
"source": [
69+
"from neo4j import GraphDatabase\n",
70+
"\n",
7171
"with GraphDatabase.driver(URI, auth=auth) as driver:\n",
7272
" driver.verify_connectivity()\n",
7373
" driver.execute_query(\n",
@@ -130,12 +130,15 @@
130130
"metadata": {},
131131
"outputs": [],
132132
"source": [
133+
"from neo4j import Result, RoutingControl\n",
134+
"\n",
133135
"with GraphDatabase.driver(URI, auth=auth) as driver:\n",
134136
" driver.verify_connectivity()\n",
135137
"\n",
136138
" result = driver.execute_query(\n",
137139
" \"MATCH (n)-[r]->(m) RETURN n,r,m\",\n",
138140
" database_=\"neo4j\",\n",
141+
" routing_=RoutingControl.READ,\n",
139142
" result_transformer_=Result.graph,\n",
140143
" )\n",
141144
"\n",

0 commit comments

Comments
 (0)