From 38ab90217f0a434840b9c48b883ce3ebe6c61869 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 25 Jun 2025 16:16:38 -0700 Subject: [PATCH] Fix assertion --- libs/langgraph/langgraph/pregel/__init__.py | 6 +++--- libs/langgraph/tests/test_large_cases.py | 6 +++--- libs/langgraph/tests/test_pregel_async.py | 4 +--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/__init__.py b/libs/langgraph/langgraph/pregel/__init__.py index 3df2bef35..8fe9fed2e 100644 --- a/libs/langgraph/langgraph/pregel/__init__.py +++ b/libs/langgraph/langgraph/pregel/__init__.py @@ -219,9 +219,9 @@ class NodeBuilder: *channels: str, ) -> Self: """Adds the specified channels to read from, without subscribing to them.""" - assert isinstance( - self._channels, list - ), "Cannot read additional channels when subscribed to single channels" + assert isinstance(self._channels, list), ( + "Cannot read additional channels when subscribed to single channels" + ) self._channels.extend(channels) return self diff --git a/libs/langgraph/tests/test_large_cases.py b/libs/langgraph/tests/test_large_cases.py index ab8752897..cb24702ff 100644 --- a/libs/langgraph/tests/test_large_cases.py +++ b/libs/langgraph/tests/test_large_cases.py @@ -1677,9 +1677,9 @@ def test_state_graph_packets( # Define decision-making logic def should_continue(data: dict) -> str: - assert ( - data["something_extra"] == "hi there" - ), "nodes can pass extra data to their cond edges, which isn't saved in state" + assert data["something_extra"] == "hi there", ( + "nodes can pass extra data to their cond edges, which isn't saved in state" + ) # Logic to decide whether to continue in the loop or exit if tool_calls := data["messages"][-1].tool_calls: return [Send("tools", tool_call) for tool_call in tool_calls] diff --git a/libs/langgraph/tests/test_pregel_async.py b/libs/langgraph/tests/test_pregel_async.py index b2d75456d..0a0fe58f5 100644 --- a/libs/langgraph/tests/test_pregel_async.py +++ b/libs/langgraph/tests/test_pregel_async.py @@ -1042,9 +1042,7 @@ async def test_partial_pending_checkpoint( "source": "update", "step": 1, }, - parent_config=( - [c async for c in tool_two.checkpointer.alist(thread1, limit=2)][-1].config - ), + parent_config=None, interrupts=(), )