From b6ea73ff2497e4e548ed4c7b7d171aaf9596d50a Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Mon, 21 Apr 2025 21:01:27 -0700 Subject: [PATCH] linting for 3.12 --- libs/langgraph/langgraph/pregel/read.py | 12 ++++++------ libs/langgraph/tests/test_checkpoint_migration.py | 6 +++--- libs/langgraph/tests/test_large_cases.py | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/read.py b/libs/langgraph/langgraph/pregel/read.py index 64ad9c966..6fb2f72cb 100644 --- a/libs/langgraph/langgraph/pregel/read.py +++ b/libs/langgraph/langgraph/pregel/read.py @@ -239,12 +239,12 @@ class PregelNode(Runnable): ) def join(self, channels: Sequence[str]) -> PregelNode: - assert isinstance(channels, list) or isinstance(channels, tuple), ( - "channels must be a list or tuple" - ) - assert isinstance(self.channels, dict), ( - "all channels must be named when using .join()" - ) + assert isinstance(channels, list) or isinstance( + channels, tuple + ), "channels must be a list or tuple" + assert isinstance( + self.channels, dict + ), "all channels must be named when using .join()" return self.copy( update=dict( channels={ diff --git a/libs/langgraph/tests/test_checkpoint_migration.py b/libs/langgraph/tests/test_checkpoint_migration.py index 2c5dd1a32..21727ba0a 100644 --- a/libs/langgraph/tests/test_checkpoint_migration.py +++ b/libs/langgraph/tests/test_checkpoint_migration.py @@ -1573,9 +1573,9 @@ def test_migrate_checkpoints(source: str, target: str) -> None: migrated["versions_seen"][c][v].split(".")[0] ) # check that the migrated checkpoint matches the target checkpoint - assert migrated == target_checkpoint.checkpoint, ( - f"Checkpoint mismatch at index {idx}" - ) + assert ( + migrated == target_checkpoint.checkpoint + ), f"Checkpoint mismatch at index {idx}" @NEEDS_CONTEXTVARS diff --git a/libs/langgraph/tests/test_large_cases.py b/libs/langgraph/tests/test_large_cases.py index 1e16a0862..195fe6c53 100644 --- a/libs/langgraph/tests/test_large_cases.py +++ b/libs/langgraph/tests/test_large_cases.py @@ -2830,9 +2830,9 @@ def test_state_graph_packets( # Define decision-making logic def should_continue(data: dict) -> str: assert isinstance(data["session"], httpx.Client) - 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]