fix(vector_stores): drop stray print in Weaviate list_cols (#5637)
This commit is contained in:
@@ -342,7 +342,6 @@ class Weaviate(VectorStoreBase):
|
|||||||
"""
|
"""
|
||||||
collections = self.client.collections.list_all()
|
collections = self.client.collections.list_all()
|
||||||
logger.debug(f"collections: {collections}")
|
logger.debug(f"collections: {collections}")
|
||||||
print(f"collections: {collections}")
|
|
||||||
return {"collections": [{"name": col.name} for col in collections]}
|
return {"collections": [{"name": col.name} for col in collections]}
|
||||||
|
|
||||||
def delete_col(self):
|
def delete_col(self):
|
||||||
|
|||||||
@@ -197,6 +197,16 @@ class TestWeaviateDB(unittest.TestCase):
|
|||||||
|
|
||||||
self.client_mock.collections.list_all.assert_called_once()
|
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):
|
def test_delete_col(self):
|
||||||
self.weaviate_db.delete_col()
|
self.weaviate_db.delete_col()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user