Skip to content

Commit 1fb37e4

Browse files
committed
style(checkpoint): apply black formatting
Auto-format code with black and isort for checkpoint 3.0 changes.
1 parent 5119f68 commit 1fb37e4

File tree

9 files changed

+23
-9
lines changed

9 files changed

+23
-9
lines changed

langgraph/checkpoint/redis/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ def put_writes(
583583
"idx": WRITES_IDX_MAP.get(channel, idx),
584584
"channel": channel,
585585
"type": type_,
586-
"blob": self._encode_blob(blob), # Encode bytes to base64 string for Redis
586+
"blob": self._encode_blob(
587+
blob
588+
), # Encode bytes to base64 string for Redis
587589
}
588590
writes_objects.append(write_obj)
589591

langgraph/checkpoint/redis/aio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,9 @@ async def aput_writes(
11221122
"idx": WRITES_IDX_MAP.get(channel, idx),
11231123
"channel": channel,
11241124
"type": type_,
1125-
"blob": self._encode_blob(blob), # Encode bytes to base64 string for Redis
1125+
"blob": self._encode_blob(
1126+
blob
1127+
), # Encode bytes to base64 string for Redis
11261128
}
11271129
writes_objects.append(write_obj)
11281130

langgraph/checkpoint/redis/ashallow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ async def aput_writes(
534534
"idx": WRITES_IDX_MAP.get(channel, idx),
535535
"channel": channel,
536536
"type": type_,
537-
"blob": self._encode_blob(blob), # Encode bytes to base64 string for Redis
537+
"blob": self._encode_blob(
538+
blob
539+
), # Encode bytes to base64 string for Redis
538540
}
539541
writes_objects.append(write_obj)
540542

langgraph/checkpoint/redis/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,9 @@ def put_writes(
571571
"idx": WRITES_IDX_MAP.get(channel, idx),
572572
"channel": channel,
573573
"type": type_,
574-
"blob": self._encode_blob(blob), # Encode bytes to base64 string for Redis
574+
"blob": self._encode_blob(
575+
blob
576+
), # Encode bytes to base64 string for Redis
575577
}
576578
writes_objects.append(write_obj)
577579

@@ -750,7 +752,9 @@ def _load_writes(
750752
(
751753
task_id,
752754
data["channel"],
753-
serde.loads_typed((data["type"], BaseRedisSaver._decode_blob_static(data["blob"]))),
755+
serde.loads_typed(
756+
(data["type"], BaseRedisSaver._decode_blob_static(data["blob"]))
757+
),
754758
)
755759
for (task_id, _), data in task_id_to_data.items()
756760
]

langgraph/checkpoint/redis/jsonplus_redis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def _default_handler(self, obj: Any) -> Any:
5151
# For other objects, encode with constructor args
5252
# Pass the class and the instance's __dict__ as kwargs
5353
return self._encode_constructor_args(
54-
type(obj),
55-
kwargs=obj.__dict__ if hasattr(obj, "__dict__") else {}
54+
type(obj), kwargs=obj.__dict__ if hasattr(obj, "__dict__") else {}
5655
)
5756
except Exception:
5857
# For types we can't handle, raise TypeError

langgraph/checkpoint/redis/shallow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ def put_writes(
529529
"idx": WRITES_IDX_MAP.get(channel, idx),
530530
"channel": channel,
531531
"type": type_,
532-
"blob": self._encode_blob(blob), # Encode bytes to base64 string for Redis
532+
"blob": self._encode_blob(
533+
blob
534+
), # Encode bytes to base64 string for Redis
533535
}
534536
writes_objects.append(write_obj)
535537

tests/test_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ async def test_search_writes_async(redis_url: str) -> None:
518518

519519
# Blobs are now base64-encoded in Redis (checkpoint 3.0)
520520
import base64
521+
521522
assert base64.b64decode(doc1["blob"]).decode() == '"value1"'
522523
assert base64.b64decode(doc2["blob"]).decode() == '"value2"'
523524
assert base64.b64decode(doc3["blob"]).decode() == '"value3"'

tests/test_jsonplus_redis_serializer_v3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"""
77

88
from langchain_core.messages import AIMessage, HumanMessage
9-
from langgraph.checkpoint.redis.jsonplus_redis import JsonPlusRedisSerializer
109
from langgraph.types import Interrupt
1110

11+
from langgraph.checkpoint.redis.jsonplus_redis import JsonPlusRedisSerializer
12+
1213

1314
def test_dumps_typed_returns_bytes_not_string() -> None:
1415
"""Test that dumps_typed returns tuple[str, bytes], not tuple[str, str]."""

tests/test_sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def test_search_writes(redis_url: str) -> None:
269269

270270
# Blobs are now base64-encoded in Redis (checkpoint 3.0)
271271
import base64
272+
272273
assert base64.b64decode(doc1["blob"]).decode() == '"value1"'
273274
assert base64.b64decode(doc2["blob"]).decode() == '"value2"'
274275
assert base64.b64decode(doc3["blob"]).decode() == '"value3"'

0 commit comments

Comments
 (0)