Support with_parameter and with_parameters in query engine#125
Support with_parameter and with_parameters in query engine#125ChunxuTang merged 12 commits intolance-format:mainfrom
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
ChunxuTang
left a comment
There was a problem hiding this comment.
@leiyuou Thanks for the contribution! This is a very nice work.
I carefully re-evaluated the three design options for the parameter support, and I think it's better to go with option 1 (replacing the parameters during the semantic analysis pass). Could you update the PR?
ChunxuTang
left a comment
There was a problem hiding this comment.
Looks good! Thanks for the update.
Just left some minor comments (mostly for code consistency).
ChunxuTang
left a comment
There was a problem hiding this comment.
@leiyuou Generally LGTM!
During the review, I found that the python_to_json method on the Python side actually doesn't support Python lists, so such a query would fail on the Python side:
query = (
CypherQuery("MATCH (n:Item) WHERE vector_distance(n.embedding, $q, 'cosine') < 0.5 RETURN n")
.with_config(config)
.with_parameter("q", [0.1, 0.2, 0.3]) # ValueError raised here
)Could you send a follow-up PR to fix the issue?
Support $param placeholder in query engine.
Supported Scalar Types:
Null
Boolean
Integer
Float
String
Supported Complex Types:
Float Vectors: Lists of numbers (e.g., [0.1, 0.2, 0.3]) are supported and converted to VectorLiteral (as Vec).
Key Changes:
CypherQuery
Closes #103.