Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions langgraph/checkpoint/redis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def put_writes(
idx_value,
)
write_keys.append(key)
pipeline.json().set(key, "$", write_obj)
pipeline.json().set(key, "$", cast(Any, write_obj))
created_keys.append(key)

# Add TTL operations to the pipeline if configured
Expand Down Expand Up @@ -636,7 +636,7 @@ def put_writes(
task_id,
idx_value,
)
fallback_pipeline.json().set(key, "$", write_obj)
fallback_pipeline.json().set(key, "$", cast(Any, write_obj))

# Add TTL operations if configured
if (
Expand Down
8 changes: 5 additions & 3 deletions langgraph/checkpoint/redis/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ async def aput_writes(
)

# Redis JSON.SET is an UPSERT by default
await self._redis.json().set(key, "$", write_obj) # type: ignore[misc]
await self._redis.json().set(key, "$", cast(Any, write_obj)) # type: ignore[misc]
created_keys.append(key)

# Apply TTL to newly created keys
Expand Down Expand Up @@ -1197,7 +1197,7 @@ async def aput_writes(
write_obj["idx"], # type: ignore[arg-type]
)

pipeline.json().set(key, "$", write_obj)
pipeline.json().set(key, "$", cast(Any, write_obj))
created_keys.append(key)

# Add TTL operations to the pipeline if configured
Expand Down Expand Up @@ -1264,7 +1264,9 @@ async def aput_writes(
task_id,
write_obj["idx"], # type: ignore[arg-type]
)
fallback_pipeline.json().set(key, "$", write_obj)
fallback_pipeline.json().set(
key, "$", cast(Any, write_obj)
)

# Add TTL operations if configured
if (
Expand Down
7 changes: 6 additions & 1 deletion langgraph/checkpoint/redis/shallow.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,12 @@ def get_channel_values(
channel_values = checkpoint.get("channel_values", {})

# Deserialize channel values since they're stored in serialized form
return self._deserialize_channel_values(channel_values)
# Cast to dict[str, Any] as we know this is the correct type from checkpoint structure
from typing import cast

return self._deserialize_channel_values(
cast(dict[str, Any], channel_values) if channel_values else {}
)

def _load_pending_sends(
self,
Expand Down
Loading