fix(neptune): honor the params kwarg in execute_query (fix MissingParameter)#4
Closed
jhurliman wants to merge 1 commit into
Closed
fix(neptune): honor the params kwarg in execute_query (fix MissingParameter)#4jhurliman wants to merge 1 commit into
jhurliman wants to merge 1 commit into
Conversation
…gParameter)
graphiti calls drivers with the Cypher parameters under a `params` kwarg, e.g.
search_utils.node_similarity_search:
await driver.execute_query(query, params=filter_params, search_vector=...,
limit=..., min_score=..., routing_='r')
Neo4jDriver.execute_query pops `params` and uses it as the query parameters.
NeptuneDriver.execute_query instead did `params = dict(kwargs)`, nesting the real
filter params (e.g. `$group_ids`) under a literal `"params"` key, so Neptune
never sees `$group_ids` and raises:
MalformedQueryException ... MissingParameter
This breaks every add_episode (entity dedup runs node_similarity_search).
Pop `params` and merge it to the top level (mirroring the Neo4j driver),
preserving the other control kwargs.
Owner
Author
|
Closing as redundant — upstream getzep/graphiti already covers this: PR getzep#1539 fixes both Neptune bugs (uninitialized |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2.
graphiti passes Cypher parameters under a
paramskwarg (the conventionNeo4jDriver.execute_queryimplements by poppingparams).NeptuneDriver.execute_querydidparams = dict(kwargs), nesting the real filter params (e.g.$group_idsfromsearch_utils.node_similarity_search) under a literal"params"key → NeptuneMalformedQueryException: MissingParameteron everyadd_episode(entity dedup runsnode_similarity_search).This pops
paramsand merges it to the top level (mirroring the Neo4j driver), preserving the other control kwargs.Verified against Amazon Neptune Serverless + OpenSearch Serverless (graphiti-core 0.29.2): with this plus #1,
add_episode/searchsucceed end-to-end.