Skip to content

Commit 8de1281

Browse files
committed
Update version to 1.0.4 in pyproject.toml and simplify collection creation in CouchbaseSaver by removing unnecessary CollectionSpec instantiation.
1 parent 7583148 commit 8de1281

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

langgraph_checkpointer_couchbase/couchbase_saver.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from couchbase.bucket import Bucket
88
from couchbase.auth import PasswordAuthenticator
99
from couchbase.options import ClusterOptions, QueryOptions, UpsertOptions
10-
from couchbase.management.collections import CollectionSpec
1110
from couchbase.exceptions import CollectionAlreadyExistsException
1211

1312
from 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}")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "langgraph-checkpointer-couchbase"
7-
version = "1.0.3"
7+
version = "1.0.4"
88
description = ''
99
readme = "README.md"
1010
requires-python = ">=3.8"

0 commit comments

Comments
 (0)