Change8

v8.0.0b1

Breaking Changes
📦 redis-pythonView on GitHub →
2 breaking3 features🐛 4 fixes1 deprecations🔧 9 symbols

Summary

This release introduces full asyncio Cluster PubSub support and comprehensive Redis Keyspace Notification APIs for both sync and async clients. It also resolves static analysis issues by strictly typing sync/async command return values using overloads.

⚠️ Breaking Changes

  • Type hints for core commands, VectorSet commands, and module commands now use @overload to provide distinct return types for sync and async clients. Code relying on the old union return types (e.g., Union[Awaitable[Any], Any]) in type annotations may need updates for static analysis tools.
  • The introduction of Keyspace Notifications in cluster mode implies that subscriptions are automatically handled across primary nodes, which might affect custom logic relying on manual subscription management across nodes.

Migration Steps

  1. If using static type checkers (like mypy), review code that consumes return types from core, VectorSet, or module commands, as the return type is now strictly typed for sync or async contexts instead of a union.

✨ New Features

  • Full asyncio Cluster PubSub support introduced, including shard-channel capabilities (SSUBSCRIBE, SUNSUBSCRIBE, SPUBLISH) via the new ClusterPubSub class in redis.asyncio.cluster.
  • Redis Keyspace Notifications are now supported for both standalone and cluster deployments, in sync and async modes, via new high-level API classes (KeyspaceNotifications, ClusterKeyspaceNotifications, AsyncKeyspaceNotifications, AsyncClusterKeyspaceNotifications).
  • Cluster PubSub automatically routes shard-channel subscriptions based on key-slot hashing and manages per-node PubSub connections.

🐛 Bug Fixes

  • Fixed disconnect() to guard against RuntimeError on Python 3.13+.
  • Fixed CacheProxyConnection hang when invalidation arrives on another connection.
  • Fixed handling of scientific notation in score_cast_func for RESP2.
  • Fixed TypeError in CacheProxyConnection when cached response is non-bytes.

Affected Symbols

⚡ Deprecations

  • Deprecation of lib_name/lib_version in async cluster is being aligned.