Skip to content

Commit ba9ac96

Browse files
committed
chore: ruff formatting
Signed-off-by: Casper Nielsen <[email protected]>
1 parent 3548b5f commit ba9ac96

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

examples/langgraph-checkpointer/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from langgraph.graph import START, MessagesState, StateGraph
77
from langgraph.prebuilt import ToolNode, tools_condition
88

9+
910
def add(a: int, b: int) -> int:
1011
"""Adds a and b.
1112

ext/dapr-ext-langgraph/tests/test_checkpointer.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -*- coding: utf-8 -*-
22

3+
import base64
34
import json
45
import unittest
5-
import msgpack
6-
import base64
76
from datetime import datetime
87
from unittest import mock
98

9+
import msgpack
1010
from dapr.ext.langgraph.dapr_checkpointer import DaprCheckpointer
1111
from langgraph.checkpoint.base import Checkpoint
1212

@@ -69,13 +69,15 @@ def test_put_saves_checkpoint_and_registry(self, mock_client_cls):
6969
first_call_kwargs = first_call.kwargs
7070
assert first_call_kwargs['store_name'] == 'statestore'
7171
assert first_call_kwargs['key'] == 'checkpoint:t1::cp1'
72-
unpacked = msgpack.unpackb(first_call_kwargs['value']) # We're packing bytes
72+
unpacked = msgpack.unpackb(first_call_kwargs['value']) # We're packing bytes
7373
saved_payload = {}
7474
for k, v in unpacked.items():
7575
k = k.decode() if isinstance(k, bytes) else k
76-
if k == 'checkpoint' or k == 'metadata': # Need to convert b'' on checkpoint/metadata dict key/values
76+
if (
77+
k == 'checkpoint' or k == 'metadata'
78+
): # Need to convert b'' on checkpoint/metadata dict key/values
7779
if k == 'metadata':
78-
v = msgpack.unpackb(v) # Metadata value is packed
80+
v = msgpack.unpackb(v) # Metadata value is packed
7981
val = {}
8082
for sk, sv in v.items():
8183
sk = sk.decode() if isinstance(sk, bytes) else sk
@@ -89,7 +91,9 @@ def test_put_saves_checkpoint_and_registry(self, mock_client_cls):
8991
second_call = mock_client.save_state.call_args_list[1]
9092
second_call_kwargs = second_call.kwargs
9193
assert second_call_kwargs['store_name'] == 'statestore'
92-
assert second_call_kwargs['value'] == 'checkpoint:t1::cp1' # Here we're testing if the last checkpoint is the first_call above
94+
assert (
95+
second_call_kwargs['value'] == 'checkpoint:t1::cp1'
96+
) # Here we're testing if the last checkpoint is the first_call above
9397

9498
def test_put_writes_updates_channel_values(self, mock_client_cls):
9599
mock_client = mock_client_cls.return_value

0 commit comments

Comments
 (0)