fix: pass database_ as connection-level parameter in Neo4jDriver.execute_query()#1577
fix: pass database_ as connection-level parameter in Neo4jDriver.execute_query()#1577wahajahmed010 wants to merge 1 commit into
Conversation
…ute_query() The database_ parameter was being placed inside the parameters_ dict, which caused it to be treated as a Cypher query parameter () rather than a connection-level database selection. This meant search queries would run on the default database instead of the target database. Fix: extract database_ from kwargs and pass it directly to self.client.execute_query() as the database_ keyword argument, keeping params separate for actual Cypher query parameters. Closes getzep#1481 Signed-off-by: Wahaj Ahmed <[email protected]>
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: [email protected] or I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: [email protected] Signature is valid for 6 months. Wahaj Ahmed seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail:[email protected] |
Description
Fixes a bug where
Neo4jDriver.execute_query()was placing thedatabase_parameter inside theparameters_dict, causing it to be treated as a Cypher query parameter ($database_) rather than a connection-level database selection. This meant search queries would run on the default database instead of the target database.Root Cause
In the original code:
The
database_value was passed insideparameters_, which is the dict for Cypher query parameters. The Neo4j Python driver expectsdatabase_as a separate keyword argument toexecute_query().Fix
Extract
database_from kwargs and pass it directly toself.client.execute_query()as thedatabase_keyword argument, keepingparamsseparate for actual Cypher query parameters.Changes
graphiti_core/driver/neo4j_driver.py: Modifiedexecute_query()to passdatabase_as a connection-level parameter instead of inside the Cypher query parameters dict.Testing
This change is a straightforward parameter passing fix. The existing test suite requires Neo4j connectivity (integration tests), which cannot be run without a running Neo4j instance. The fix follows the same pattern used by
transaction()andsession()methods which correctly passdatabase=self._database.Closes #1481
This PR was created with AI assistance.