From 9b4fb32ce5dbf6b2a103fef159220607a19c2165 Mon Sep 17 00:00:00 2001
From: Xi Yang <31660137+BetaGoal@users.noreply.github.com>
Date: Mon, 11 Mar 2024 11:19:01 -0400
Subject: [PATCH] Update verifying connection (#11821)

---
 .../llama_index/graph_stores/neo4j/base.py                     | 3 ++-
 .../graph_stores/llama-index-graph-stores-neo4j/pyproject.toml | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/base.py b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/base.py
index 93f972421..59d7ecac0 100644
--- a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/base.py
+++ b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/base.py
@@ -51,7 +51,8 @@ class Neo4jGraphStore(GraphStore):
         self.structured_schema: Dict[str, Any] = {}
         # Verify connection
         try:
-            self._driver.verify_connectivity()
+            with self._driver as driver:
+                driver.verify_connectivity()
         except neo4j.exceptions.ServiceUnavailable:
             raise ValueError(
                 "Could not connect to Neo4j database. "
diff --git a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml
index 46c572eb3..d6f71abfc 100644
--- a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml
+++ b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml
@@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
 license = "MIT"
 name = "llama-index-graph-stores-neo4j"
 readme = "README.md"
-version = "0.1.2"
+version = "0.1.3"
 
 [tool.poetry.dependencies]
 python = ">=3.8.1,<4.0"
-- 
GitLab