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 93f972421c515271119cc0cc7d68754479f562c1..59d7ecac0bb7bd76b103ed3a81fafd8f26e23408 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 46c572eb30a6b9879a4d1a7fd06da050a84ee76b..d6f71abfc64e94738a99b90315b33a29c47ee5b9 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"