Skip to content

Conversation

matthewshirley
Copy link
Contributor

In PR #67, the Redis constraint was removed (>=5.0,<7.0) and reintroduced for >6.2.0 in 13ddc96. As per the README, redis>=5.2.1 is the minimum version supported.

I don't, as far as I can tell, believe the ^6.2.0 constraint is correct. However, if it is, I can alternatively update the documentation.

@bsbodden bsbodden self-assigned this Oct 2, 2025
@bsbodden bsbodden self-requested a review October 2, 2025 02:44
Copy link
Contributor

@bsbodden bsbodden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redis version constraint change looks good and aligns with the documentation. However, this PR will fail CI due to mypy errors introduced by stricter type hints in redis-py 6.3.0+.

The following files need type casting fixes to pass mypy checks:


File: langgraph/checkpoint/redis/shallow.py (around line 641)

Change:

return self._deserialize_channel_values(channel_values)

To:

# 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 {}
)

File: langgraph/checkpoint/redis/aio.py

Three locations need cast(Any, write_obj):

  • Line 1144: await self._redis.json().set(key, "$", cast(Any, write_obj)) # type: ignore[misc]
  • Line 1200: pipeline.json().set(key, "$", cast(Any, write_obj))
  • Line 1267: fallback_pipeline.json().set(key, "$", cast(Any, write_obj))

File: langgraph/checkpoint/redis/__init__.py

Two locations need cast(Any, write_obj):

  • Line 604: pipeline.json().set(key, "$", cast(Any, write_obj))
  • Line 639: fallback_pipeline.json().set(key, "$", cast(Any, write_obj))

Root cause: redis-py 6.3.0+ introduced stricter JsonType type hints for JSONCommands.set() that require explicit casting.

Verification: All 350 tests pass with these changes and mypy passes cleanly.

@bsbodden
Copy link
Contributor

bsbodden commented Oct 2, 2025

Closing in favor of #103 in order to make into the release. Thank you @matthewshirley

@bsbodden bsbodden closed this Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants