77from couchbase .bucket import Bucket
88from couchbase .auth import PasswordAuthenticator
99from couchbase .options import ClusterOptions , QueryOptions , UpsertOptions
10- from couchbase .management .collections import CollectionSpec
1110from couchbase .exceptions import CollectionAlreadyExistsException
1211
1312from langgraph .checkpoint .base import (
@@ -115,9 +114,8 @@ def create_collections(self):
115114
116115 collection_manager = self .bucket .collections ()
117116 try :
118- collection_spec = CollectionSpec (collection_name = self .checkpoints_collection_name , scope_name = self .scope_name )
119- collection_manager .create_collection (collection_spec )
120- except CollectionAlreadyExistsException as caee :
117+ collection_manager .create_collection (self .checkpoints_collection_name , self .scope_name )
118+ except CollectionAlreadyExistsException as _ :
121119 pass
122120 except Exception as e :
123121 print (f"Error creating collections: { e } " )
@@ -126,9 +124,8 @@ def create_collections(self):
126124 self .checkpoints_collection = self .bucket .scope (self .scope_name ).collection (self .checkpoints_collection_name )
127125
128126 try :
129- collection_spec = CollectionSpec (collection_name = self .checkpoint_writes_collection_name , scope_name = self .scope_name )
130- collection_manager .create_collection (collection_spec )
131- except CollectionAlreadyExistsException as caee :
127+ collection_manager .create_collection (self .checkpoint_writes_collection_name , self .scope_name )
128+ except CollectionAlreadyExistsException as _ :
132129 pass
133130 except Exception as e :
134131 print (f"Error creating collections: { e } " )
0 commit comments