diff --git a/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/__init__.py b/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/__init__.py index 1002eebe8..7a873ab4b 100644 --- a/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/__init__.py +++ b/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/__init__.py @@ -42,7 +42,7 @@ class DuckDBSaver(BaseDuckDBSaver): DuckDBSaver: A new DuckDBSaver instance. """ with duckdb.connect(conn_string) as conn: - yield DuckDBSaver(conn) + yield cls(conn) def setup(self) -> None: """Set up the checkpoint database asynchronously. diff --git a/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/aio.py b/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/aio.py index aa52feb18..54c1924cc 100644 --- a/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/aio.py +++ b/libs/checkpoint-duckdb/langgraph/checkpoint/duckdb/aio.py @@ -45,7 +45,7 @@ class AsyncDuckDBSaver(BaseDuckDBSaver): AsyncDuckDBSaver: A new AsyncDuckDBSaver instance. """ with duckdb.connect(conn_string) as conn: - yield AsyncDuckDBSaver(conn) + yield cls(conn) async def setup(self) -> None: """Set up the checkpoint database asynchronously. diff --git a/libs/checkpoint-duckdb/langgraph/store/duckdb/aio.py b/libs/checkpoint-duckdb/langgraph/store/duckdb/aio.py index d6fd7dd89..f050f449b 100644 --- a/libs/checkpoint-duckdb/langgraph/store/duckdb/aio.py +++ b/libs/checkpoint-duckdb/langgraph/store/duckdb/aio.py @@ -156,7 +156,7 @@ class AsyncDuckDBStore(AsyncBatchedBaseStore, BaseDuckDBStore): AsyncDuckDBStore: A new AsyncDuckDBStore instance. """ with duckdb.connect(conn_string) as conn: - yield AsyncDuckDBStore(conn) + yield cls(conn) async def setup(self) -> None: """Set up the store database asynchronously. diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py index 4c0f5295c..3a1e13db1 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py @@ -54,7 +54,7 @@ class AsyncPostgresSaver(BasePostgresSaver): pipeline: bool = False, serde: Optional[SerializerProtocol] = None, ) -> AsyncIterator["AsyncPostgresSaver"]: - """Create a new PostgresSaver instance from a connection string. + """Create a new AsyncPostgresSaver instance from a connection string. Args: conn_string (str): The Postgres connection info string. diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py index b552a75f4..ea749473c 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py @@ -110,7 +110,7 @@ class SqliteSaver(BaseCheckpointSaver[str]): check_same_thread=False, ) ) as conn: - yield SqliteSaver(conn) + yield cls(conn) def setup(self) -> None: """Set up the checkpoint database. diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py index 21cde06e0..72fca5bea 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py @@ -137,7 +137,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]): AsyncSqliteSaver: A new AsyncSqliteSaver instance. """ async with aiosqlite.connect(conn_string) as conn: - yield AsyncSqliteSaver(conn) + yield cls(conn) def get_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]: """Get a checkpoint tuple from the database.