Fixes n_embeddings use and error for memgraph (#3296)

This commit is contained in:
Parshva Daftari
2025-08-11 12:57:29 -05:00
committed by GitHub
parent c2792c6558
commit b60a208c2f
3 changed files with 31 additions and 24 deletions
+6 -3
View File
@@ -231,7 +231,7 @@ class TestQdrant(unittest.TestCase):
score=0.95,
payload={"user_id": "alice", "agent_id": "agent1", "run_id": "run1"}
)
self.client_mock.scroll.return_value = MagicMock(points=[mock_point])
self.client_mock.scroll.return_value = [mock_point]
filters = {"user_id": "alice", "agent_id": "agent1", "run_id": "run1"}
results = self.qdrant.list(filters=filters, limit=10)
@@ -247,6 +247,7 @@ class TestQdrant(unittest.TestCase):
self.assertIsInstance(scroll_filter, Filter)
self.assertEqual(len(scroll_filter.must), 3) # user_id, agent_id, run_id
# The list method returns the result directly
self.assertEqual(len(results), 1)
self.assertEqual(results[0].payload["user_id"], "alice")
self.assertEqual(results[0].payload["agent_id"], "agent1")
@@ -259,7 +260,7 @@ class TestQdrant(unittest.TestCase):
score=0.95,
payload={"user_id": "alice"}
)
self.client_mock.scroll.return_value = MagicMock(points=[mock_point])
self.client_mock.scroll.return_value = [mock_point]
filters = {"user_id": "alice"}
results = self.qdrant.list(filters=filters, limit=10)
@@ -270,19 +271,21 @@ class TestQdrant(unittest.TestCase):
self.assertIsInstance(scroll_filter, Filter)
self.assertEqual(len(scroll_filter.must), 1) # Only user_id
# The list method returns the result directly
self.assertEqual(len(results), 1)
self.assertEqual(results[0].payload["user_id"], "alice")
def test_list_with_no_filters(self):
"""Test list with no filters."""
mock_point = MagicMock(id=str(uuid.uuid4()), score=0.95, payload={"key": "value"})
self.client_mock.scroll.return_value = MagicMock(points=[mock_point])
self.client_mock.scroll.return_value = [mock_point]
results = self.qdrant.list(filters=None, limit=10)
call_args = self.client_mock.scroll.call_args[1]
self.assertIsNone(call_args["scroll_filter"])
# The list method returns the result directly
self.assertEqual(len(results), 1)
def test_delete_col(self):