7
7
from couchbase .bucket import Bucket
8
8
from couchbase .auth import PasswordAuthenticator
9
9
from couchbase .options import ClusterOptions , QueryOptions , UpsertOptions
10
- from couchbase .management .collections import CollectionSpec
11
10
from couchbase .exceptions import CollectionAlreadyExistsException
12
11
13
12
from langgraph .checkpoint .base import (
@@ -115,9 +114,8 @@ def create_collections(self):
115
114
116
115
collection_manager = self .bucket .collections ()
117
116
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 _ :
121
119
pass
122
120
except Exception as e :
123
121
print (f"Error creating collections: { e } " )
@@ -126,9 +124,8 @@ def create_collections(self):
126
124
self .checkpoints_collection = self .bucket .scope (self .scope_name ).collection (self .checkpoints_collection_name )
127
125
128
126
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 _ :
132
129
pass
133
130
except Exception as e :
134
131
print (f"Error creating collections: { e } " )
0 commit comments