diff --git a/libs/community/langchain_community/graphs/neo4j_graph.py b/libs/community/langchain_community/graphs/neo4j_graph.py index 901e9604f6242..baca74bb3e4ed 100644 --- a/libs/community/langchain_community/graphs/neo4j_graph.py +++ b/libs/community/langchain_community/graphs/neo4j_graph.py @@ -430,7 +430,7 @@ def query( try: data, _, _ = self._driver.execute_query( Query(text=query, timeout=self.timeout), - database=self._database, + database_=self._database, parameters_=params, ) json_data = [r.data() for r in data] @@ -457,7 +457,7 @@ def query( ): raise # fallback to allow implicit transactions - with self._driver.session() as session: + with self._driver.session(database=self._database) as session: data = session.run(Query(text=query, timeout=self.timeout), params) json_data = [r.data() for r in data] if self.sanitize: diff --git a/libs/community/langchain_community/vectorstores/neo4j_vector.py b/libs/community/langchain_community/vectorstores/neo4j_vector.py index 6f21eedd4534e..bb0be02afdd74 100644 --- a/libs/community/langchain_community/vectorstores/neo4j_vector.py +++ b/libs/community/langchain_community/vectorstores/neo4j_vector.py @@ -623,7 +623,7 @@ def query( params = params or {} try: data, _, _ = self._driver.execute_query( - query, database=self._database, parameters_=params + query, database_=self._database, parameters_=params ) return [r.data() for r in data] except Neo4jError as e: @@ -646,7 +646,7 @@ def query( ): raise # Fallback to allow implicit transactions - with self._driver.session() as session: + with self._driver.session(database=self._database) as session: data = session.run(Query(text=query), params) return [r.data() for r in data]