Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

fix(vector_stores): drop stray print in Weaviate list_cols (#5637)

Yash Singhbd7ce2c13cd6
diff --git a/mem0/vector_stores/weaviate.py b/mem0/vector_stores/weaviate.py
index 038528db6..c341b8a45 100644
--- a/mem0/vector_stores/weaviate.py
+++ b/mem0/vector_stores/weaviate.py
@@ -342,7 +342,6 @@ class Weaviate(VectorStoreBase):
"""
collections = self.client.collections.list_all()
logger.debug(f"collections: {collections}")
- print(f"collections: {collections}")
return {"collections": [{"name": col.name} for col in collections]}
def delete_col(self):
diff --git a/tests/vector_stores/test_weaviate.py b/tests/vector_stores/test_weaviate.py
index e7dcd3b6d..d246e08df 100644
--- a/tests/vector_stores/test_weaviate.py
+++ b/tests/vector_stores/test_weaviate.py
@@ -197,6 +197,16 @@ class TestWeaviateDB(unittest.TestCase):
self.client_mock.collections.list_all.assert_called_once()
+ def test_list_cols_does_not_print(self):
+ mock_collection = MagicMock()
+ mock_collection.name = "collection1"
+ self.client_mock.collections.list_all.return_value = [mock_collection]
+
+ with patch("builtins.print") as mock_print:
+ self.weaviate_db.list_cols()
+
+ mock_print.assert_not_called()
+
def test_delete_col(self):
self.weaviate_db.delete_col()