-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix missing commas in Kuzu graph INSERT queries #3358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@Padarn Can you please sign the CLA? |
tests/memory/test_kuzu.py
Outdated
@@ -78,6 +79,32 @@ def test_kuzu_memory_initialization( | |||
assert kuzu_memory.llm == mock_llm | |||
assert kuzu_memory.threshold == 0.7 | |||
|
|||
@patch("mem0.memory.kuzu_memory.EmbedderFactory") | |||
@patch("mem0.memory.kuzu_memory.LlmFactory") | |||
def test_kuzu_missing_comma_bug_scenario(self, mock_llm_factory, mock_embedder_factory, mock_config, mock_embedding_model, mock_llm): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks sorry I was testing this locally to make sure it was fixed, this can be removed
5558523
to
4448208
Compare
4448208
to
1400eeb
Compare
@@ -109,12 +111,21 @@ def test_kuzu(self, mock_llm_factory, mock_embedder_factory, mock_config, mock_e | |||
assert get_node_count(kuzu_memory) == 3 | |||
assert get_edge_count(kuzu_memory) == 4 | |||
|
|||
data3 = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for scenario which bug was found in
Can you also provide me how to recreate this issue? |
If you run the unit test without the fix then you will get the error: from my branch
error
|
Description
Fixed two missing commas in the Kuzu memory graph insertion queries:
source.mentions = 1
in ON CREATE SET clause (line 526)source.mentions = coalesce(source.mentions, 0) + 1
in ON MATCH SET clause (line 529)These syntax errors caused Kuzu parser exceptions when inserting entities with embeddings where the destination node exists but the source node is new.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I've added a unit test to the change
Please delete options that are not relevant.
Checklist:
Maintainer Checklist