From 9cfb4b01c86d84dc3bade511da8e87b6ebee70bc Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Mon, 19 Aug 2024 15:54:49 -0700 Subject: [PATCH] postgres: Fix args to put_writes --- .../langgraph/checkpoint/postgres/__init__.py | 12 +++++++----- .../langgraph/checkpoint/postgres/aio.py | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py index 767b8f0e8..02d5880a0 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py @@ -319,11 +319,13 @@ class PostgresSaver(BasePostgresSaver): with self._cursor(pipeline=True) as cur: cur.execute( self.DELETE_WRITES_SQL, - config["configurable"]["thread_id"], - config["configurable"]["checkpoint_ns"], - config["configurable"]["checkpoint_id"], - task_id, - len(writes), + ( + config["configurable"]["thread_id"], + config["configurable"]["checkpoint_ns"], + config["configurable"]["checkpoint_id"], + task_id, + len(writes), + ), ) cur.executemany( self.UPSERT_CHECKPOINT_WRITES_SQL, diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py index cdbbe990a..7ddb81237 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py @@ -275,11 +275,13 @@ class AsyncPostgresSaver(BasePostgresSaver): async with self._cursor(pipeline=True) as cur: await cur.execute( self.DELETE_WRITES_SQL, - config["configurable"]["thread_id"], - config["configurable"]["checkpoint_ns"], - config["configurable"]["checkpoint_id"], - task_id, - len(writes), + ( + config["configurable"]["thread_id"], + config["configurable"]["checkpoint_ns"], + config["configurable"]["checkpoint_id"], + task_id, + len(writes), + ), ) await cur.executemany( self.UPSERT_CHECKPOINT_WRITES_SQL,