Hi,
I am beginner with Python and Neo4j and I am getting a DepracationWarning. Specifically: DeprecationWarning: Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.
I verify the driver connection using a with
on the top of the script and then execute a query throughout the rest of the script.
Here's the code:
with GraphDatabase.driver(URI, auth=AUTH) as driver:
driver.verify_connectivity()
def retrieve_from_neo4j(query):
records, summary, keys = driver.execute_query(
query,
database_="neo4j",
)
result = []
# Loop through results and do something with them
for record in records:
result.append(record)
return result
The retrieve_from_neo4j
is called many times during one run.