Skip to content

Releases: redis/redis-py

8.0.0b1

08 Apr 12:20

Choose a tag to compare

8.0.0b1 Pre-release
Pre-release

Changes

Async Cluster PubSub & Keyspace Notifications

This release introduces full asyncio Cluster PubSub support, bringing shard-channel capabilities (SSUBSCRIBE, SUNSUBSCRIBE, SPUBLISH) to the async RedisCluster client. The new ClusterPubSub class in redis.asyncio.cluster automatically routes shard-channel subscriptions to the correct cluster node based on key-slot hashing, manages per-node PubSub connections, and supports round-robin message retrieval across nodes. Users can create a cluster pubsub instance via RedisCluster.pubsub() and use ssubscribe(), sunsubscribe(), and get_sharded_message() just as they would with the sync cluster client.

Alongside this, Redis Keyspace Notifications are now supported for both standalone and cluster deployments, in both sync and async modes. New classesβ€”KeyspaceNotifications, ClusterKeyspaceNotifications, AsyncKeyspaceNotifications, and AsyncClusterKeyspaceNotificationsβ€”provide a high-level API for subscribing to keyspace and keyevent channels. In cluster mode, notifications are automatically subscribed across all primary nodes (since each node only emits notifications for keys it owns), with built-in topology-change handling. Convenience methods like subscribe_keyspace(), subscribe_keyevent(), and channel classes (KeyspaceChannel, KeyeventChannel) simplify common subscription patterns. Both sync run_in_thread() and async listen() workflows are supported.

Type Hints Improvements (breaking changes)

The @overload pattern has been applied systematically across core commands (core.py), VectorSet commands, and module commands (Search, JSON, TimeSeries, Bloom filters) to provide distinct return types for sync and async clients. Previously, methods returned a combined ResponseT (i.e., Union[Awaitable[Any], Any]), which caused static analysis tools like mypy and Pyright to flag false positives. Now, sync clients see concrete return types (e.g., int, bool, list[str]) while async clients see Awaitable[...] wrappers. This is a breaking change for type-checking onlyβ€”runtime behavior is unchanged, but code relying on the old union return types in type annotations may need updates. Two new protocol types, SyncClientProtocol and AsyncClientProtocol, are used in overload signatures to enable this distinction.

πŸš€ New Features

  • Support Cluster PubSub in asyncio (#3736)
  • Add Redis Keyspace Notifications Support for Redis Cluster (#3962)

πŸ”₯ Breaking changes

  • Type hints improvements - fixing static code analyses issues related to combined sync and async return types(vectorsets + commands in core.py) (#3991)
  • Type hints improvements - fixing static code analyses issues related to combined sync and async return types - modules (#4005)
  • Add Redis Keyspace Notifications Support for Redis Cluster (#3962)

πŸ› Bug Fixes

  • fix: guard disconnect() against RuntimeError on Python 3.13+ (#3856) (#4013)
  • Fix CacheProxyConnection hang when invalidation arrives on another connection (#3600) (#4014)
  • fix: handle scientific notation in score_cast_func for RESP2 (#4016)
  • Fix TypeError in CacheProxyConnection when cached response is non-bytes (#4017)

⚠️ Deprecations

  • Align deprecation of lib_name/lib_version in async cluster (#3995)

🧰 Maintenance

  • Adding unstable 8.8 build to pipeline test matrix. Updating the lib version in master. (#4004)
  • Fix type hints for register_script to support RedisCluster (#3876)
  • Updating dependencies to fix reported vulnerabilities (#4012)
  • Bump release-drafter/release-drafter from 6 to 7 (#4019)
  • Bump rojopolis/spellcheck-github-actions from 0.58.0 to 0.60.0 (#4018)

We'd like to thank all the contributors who worked on this release!
@abersheeran @alisaifee @majiayu000 @dmaier-redislabs @vladvildanov @petyaslavova

7.4.0

24 Mar 09:14

Choose a tag to compare

Changes

πŸ› Bug Fixes

  • Fix AttributeError in cluster metrics recording when connection is None or ClusterNode object instance is used to extract the connection info (#3999)
  • Fixing security concern in repr methods for ConnectionPools - passwords might leak in plain text logs (#3998)
  • Refactored connection count and SCH metric collection (#4001)

πŸ§ͺ Experimental Features

-Refactored health check logic for MultiDBClient (#3994)

🧰 Maintenance

  • Expose basic Otel classes and functions to be importable through redis.observability to match the examples in the readthedocs (#3996)

We'd like to thank all the contributors who worked on this release!
@vladvildanov @petyaslavova

7.3.0

06 Mar 18:15

Choose a tag to compare

Changes

OpenTelemetry Native Metrics Support for asynchronous clients
Added comprehensive OpenTelemetry metrics support for asynchronous clients following the OpenTelemetry Database Client Semantic Conventions.
Metric groups include:

  • Command metrics: Operation duration with retry tracking
  • Connection basic: Connection count and creation time
  • Resiliency: Errors, handoffs, timeout relaxation
  • Connection advanced: Wait time and use time
  • Pubsub metrics: Published and received messages
  • Stream metrics: Processing duration and maintenance notifications

πŸš€ New Features

  • Added OTel instrumentation and metrics export for async client (#3977)

πŸ› Bug Fixes

  • [async] Adding access to cluster client's nodes_manager and set_response_callback in ClusterPipeline objects (#3989)
  • fix(connection): Ensure we have an initialized protocol in connection (#3981)

🧰 Maintenance

  • fix: use KeysT for blpop and brpop keys parameter type annotation (#3987 #3990)
  • Bump actions/upload-artifact from 6 to 7 (#3985)
  • fix: replace 3 bare except clauses with except Exception (#3980)

We'd like to thank all the contributors who worked on this release!
@mitre88 @turanalmammadov @haosenwang1018 @Medno @vladvildanov @petyaslavova

7.2.1

25 Feb 20:04

Choose a tag to compare

Changes

πŸ› Bug Fixes

  • Handle connection attributes conditionally for metrics and set connection data on exceptions in cluster error handling (#3964)

⚠️ Deprecations

  • Removed batch_size and consumer_name attributes from OTel metrics (#3978)

🧰 Maintenance

  • Fixing error handling of connection buffer purging of closed connections. Enabling troubleshooting logging for maintenance notifications e2e tests. (#3971)
  • Fix protocol validation: replace finally with else and store parsed int (#3965)
  • Return copies from _get_free/in_use_connections and fix async _mock (#3967)
  • Add missing shard channel message types to async PubSub (#3966)
  • Fix issues with ClusterPipeline connection management (#3804)
  • fix(pubsub): avoid UnicodeDecodeError on reconnect with binary channel names (#3944)
  • Hold references to ClusterNode disconnect task (#3826)
  • remove remaining imports of typing_extensions (#3873)

We'd like to thank all the contributors who worked on this release!
@dotlambda @rhoboro @skylarkoo7 @praboud @bysiber @vladvildanov @petyaslavova

7.2.0

16 Feb 17:15

Choose a tag to compare

Changes

Redis 8.6 Support
Added support for Redis 8.6, including new commands and features for streams idempotent production and HOTKEYS.

Smart Client Handoff (Maintenance Notifications) for Cluster
note: Pending a Redis Enterprise version release

This release introduces comprehensive support for Redis Enterprise Cluster maintenance notifications via SMIGRATING/SMIGRATED push notifications. The client now automatically handles slot migrations by:

Relaxing timeouts during migration (SMIGRATING) to prevent false failures
Triggering cluster state reloads upon completion (SMIGRATED)
Enabling seamless operations during Redis Enterprise maintenance windows

OpenTelemetry Native Metrics Support
Added comprehensive OpenTelemetry metrics support following the OpenTelemetry Database Client Semantic Conventions.
Metric groups include:

  • Command metrics: Operation duration with retry tracking
  • Connection basic: Connection count and creation time
  • Resiliency: Errors, handoffs, timeout relaxation
  • Connection advanced: Wait time and use time
  • Pubsub metrics: Published and received messages
  • Stream metrics: Processing duration and maintenance notifications

πŸš€ New Features

  • Added OTel instrumentation and metrics export for sync client (#3954)
  • Add maintenance notifications support for OSS API cluster clients (#3946)
  • Adding hotkeys commands support. (#3924)
  • Adds support for the new Idempotent Producers feature in Redis 8.6 (#3926)
  • Adding support for vrange command. (#3927)
  • Added a local digest command to the client to execute the XXH3 locally… (#3884)
  • Add DriverInfo class for upstream driver tracking (#3880)
  • Add ssl_password support to async Redis client (#3878)
  • Add ssl_ca_path support to async Redis client (#3879)

⚠️ Deprecations

  • Adding special handling of client_tracking_on and client_tracking_off for cluster clients. Marking those two functions as deprecated for cluster - embedded client-side caching feature should be used instead. (#3858)

πŸ› Bug Fixes

  • Fix handling of circular MOVED redirects in cluster slot mapping (#3899)
  • fix(asyncio): prevent deadlock when Lock.release() is cancelled (#3900)
  • Fix unrecoverable connection state (#3905)
  • Fixed potential race condition between call_later() and run_forever() (#3897)
  • Fix RuntimeError in ClusterPubSub sharded message generator (#3889)
  • Fix async connection pool lock contention during connection establishment (#3885)
  • Fix PubSub client health check handling for sync client implementation (#3870)
  • Adding retries for the overall connect - socket connect + handshake. Fix for pubsub reconnect issues. (#3863)
  • Adding special handling of client_tracking_on and client_tracking_off for cluster clients. Marking those two functions as deprecated for cluster - embedded client-side caching feature should be used instead. (#3858)
  • [#3618] Fix client-side cache invalidation for mixed str and bytes Redis keys (#3766)
  • [#3612] Generating unique command cache key (#3765)

🧰 Maintenance

  • Fix type hints for spop and srandmember methods (#3943)
  • Reorganize pipeline actions (#3951)
  • Extending the tests to validate more supported scorers for hybrid search. Adding experimental_method annotation to hybrid_search commands. (#3939)
  • Bump rojopolis/spellcheck-github-actions from 0.56.0 to 0.58.0 (#3930)
  • Adds a new helper that runs linters and fixes issues (#3928)
  • Added testing with Timeseries samples with NaN values (#3932)
  • Added testing with TLS-based authentication (#3931)
  • Added support for calling run-tests from other repositories (#3923)
  • Updating hybrid tests to be compatible with 8.4 and 8.6 changes. Adding 8.6 RC1 image to test matrix (#3922)
  • Fix ClusterClient behavior when cluster topology is refreshed. Fix several places where connections might leak. (#3917)
  • Fix copy-paste error in CacheProxyConnection server version check (#3918)
  • Improve NodesManager locking (#3803)
  • DOC: README Update relative urls (#3914)
  • Bump rojopolis/spellcheck-github-actions from 0.55.0 to 0.56.0 (#3902)
  • Bump actions/upload-artifact from 5 to 6 (#3901)
  • Fix type hinting of zrange and zrangestore (#3872)
  • Remove last vestiges of mock.mock (#3830)
  • Improve type hints of from_url method for async Redis client. (#3796)
  • Fix type hints for the available 'from_url' methods (#3816)
  • Bump rojopolis/spellcheck-github-actions from 0.53.0 to 0.55.0 (#3862)
  • Bump actions/checkout from 5 to 6 (#3861)
  • Use MaxConnectionsError in the asyncio pool too (#3859)
  • Updates PR template order (#3855)
  • Changing current version in pipeline test config to 8.4 as it is already GA (#3854)
  • Added custom event handler section (#3853)
  • Changing log level to be debug for failed maintenance notification enablement when enabled='auto' (#3851)
  • Update Type Hints for List Command Parameters from str to KeyT (#3848)
  • Expand cluster READ_COMMANDS with additional read-only commands and reorganize the list of commands by category (#3845)

We'd like to thank all the contributors who worked on this release!
@veeceey @dariaguy @Nepomuk5665 @praboud @Timour-Ilyas @barshaul @devbyteai @itssimon @majiayu000 @aveao @s-t-e-v-e-n-k @cheizdo2-art @Jonathan-Landeed @PeterJCLaw @ShubhamKaudewar @vchomakov @dmaier-redislabs @elena-kolevska @vladvildanov @petyaslavova

7.1.1

09 Feb 18:39

Choose a tag to compare

Changes

πŸ§ͺ Experimental Features

  • Added initial health check policies, refactored add_database method (#3906)

🧰 Maintenance

  • Disabled SCH in MultiDBClient underlying clients by default (#3938)
  • Added logging for MultiDBClients (#3865 #3896)

We'd like to thank all the contributors who worked on this release!
@vladvildanov

7.1.0

19 Nov 15:54

Choose a tag to compare

Changes

πŸš€ New Features

  • Adding MSETEX command support. (#3823)
  • Adding CLAIM option to XREADGROUP command + unit tests (#3825)
  • Apply routing and response aggregation policies in OSS Cluster mode (#3834)

πŸ§ͺ Experimental Features

  • Adding support for CAS/CAD commands. (#3837)
  • Adding support for HYBRID search. (#3813 #3843)

πŸ”₯ Breaking changes (in experimental features)

  • Replace default health check and failure detector with custom (#3822)

πŸ› Bug Fixes

  • Add **options to parse functions for sentinel (#3831)
  • Generating unique command cache key (#3765)

🧰 Maintenance

  • Adding Redis 8.4 RC1 image to test matrix. (#3820)
  • Remove Python 3.9 support. Add Python 3.14 support. (#3814)
  • Sync readme with 7.0.1 and update lib version to latest stable released version - 7.0.1 (#3821)
  • Bump rojopolis/spellcheck-github-actions from 0.52.0 to 0.53.0 (#3827)
  • Bump actions/upload-artifact from 4 to 5 (#3828)
  • Bump github/codeql-action from 3 to 4 (#3829)
  • Fixing flaky tests (#3833 #3838)
  • Update 8.4 RC image tag to 8.4-RC1-pre.2 for pipeline test matrix (#3832)
  • Add missing f-string when returning an error. (#3841)
  • Adding latest 8.4 image to test matrix. Updating the Hybrid VSIM query format to be in sync with spec after srv issue was fixed. (#3843)
  • Expand cluster READ_COMMANDS with additional read-only commands and reorganize the list of commands by category (#3845)
  • Update Type Hints for List Command Parameters from str to KeyT (#3848)
  • Changing log level to be debug for failed maintenance notification enablement when enabled='auto' (#3851)
  • Added custom event handler section (#3853)
  • Changing current version to 8.4 as it is already GA (#3854)

We'd like to thank all the contributors who worked on this release!
@ShubhamKaudewar @matthewwiese @peperon @vladvildanov @petyaslavova

7.0.1

27 Oct 14:32

Choose a tag to compare

Changes

This release adds small fixes related to documentation.

🧰 Maintenance

  • Add 'multi_database' section to documentation index (313d93f)
  • Revised multi-database client documentation(78df745)
  • Adding info about Multi-database client in README.md (3f7a55e)

We'd like to thank all the contributors who worked on this release!
@dmaier @petyaslavova

7.0.0

22 Oct 15:38

Choose a tag to compare

Changes

One of the main features introduced in this release is a new type of client MultiDBClient. The purpose of this client is a communication with multiple databases that are eventually consistent (Active-Active setup) and handling failures by failover across databases.
More information could be found in docs.

πŸš€ New Features

  • Support for maintenance push notifications handling during server upgrade or maintenance procedures. (#3756 #3777 #3778 #3779 #3785)
  • Adding WITHATTRIBS option to vector set's vsim command. (#3746)
  • Adding ssl_verify_flags_config argument for ssl connection configuration (#3772)
  • Adding new ExternalAuthProviderError that will be raised when we receive 'problem with LDAP service' response from server. (#3808)

πŸ§ͺ Experimental Features

  • Multi-database client implementation (#3784 #3811)

πŸ”₯ Breaking changes

  • Adding abstract method declaration for cache property setter in EvictionPolicyInterface(#3732)
  • Remove unused parse_list_to_dict function from helpers (#3733)
  • Removing synchronous context manager handling from async RedisCluster. (#3679)
  • Redis Search/Aggregate improved type annotations (#3676)
  • Removing the threading.Lock locks and replacing them with RLock objects to avoid deadlocks. (#3677)
  • Update ping command docstrings and method return type hint (#3789)
  • Fixing several *arg type hints in core.py and json module commands (#3793)
  • Fixing errors reported by mypy in search module files - query.py, commands.py and aggregation.py. (#3666)
  • Adding score_cast_func argument to zrank, zrevrank and zunion - for consistency with the other sorted sets commands (#3795)
  • Changing the timeout typehint in async BlockingConnectionPool from int to float (#3801)

πŸ› Bug Fixes

  • Removing the threading.Lock locks and replacing them with RLock objects to avoid deadlocks. (#3677)

🧰 Maintenance

  • Bump actions/checkout from 4 to 5 (#3760)
  • Fix docstring for ssl_check_hostname (#3761)
  • Typos in vectorset commands.py (#3719)
  • Fixing typos in query.py (#3718)
  • Typos in cluster.py (#3717)
  • Fixing typos in core.py (#3720)
  • Update Redis image versions for GH pipeline actions. (#3740)
  • Support the customization of the timeout parameter when using a blocking connection pool with a redis cluster (#3724)
  • Fix async clients safety when used as an async context manager (#3512)
  • docs: fix zadd command parameter description (#3727)
  • Fault injector boilerplate (#3749)
  • Adding e2e scenario tests for maintenance push notifications handling. (#3758)
  • Adding more e2e tests related to maintenance notifications. Extracting specific tests that validate notifications are received in new connections (#3770)
  • Renaming of classes and configuration arguments related to maintenance push notifications handling during server upgrade or maintenance procedures (#3777 #3778)
  • DOC-5743 BITOP examples (#3776)
  • Improve stale issue management workflow (#3773)
  • [DOC] Add complex chaining example using pipelines with builder pattern (#3774)
  • Fix automation scenario maint notification (#3788)
  • Add redis 8.4-M01-pre to tested redis versions (#3790)
  • Add handling of empty spaces during CLIENT LIST response parsing (#3797)
  • DOC-5821 update index/query example for runnable notebook (#3807)
  • Fixing SORTABLE, INDEXEMPTY and INDEXMISSING order when using RediSearch fields (#3810)
  • Fixing argument type hints for evalsha and similar commands. (#3794)
  • Update Python version to 3.14 in hiredis CI workflow (#3798)
  • Fixing sync BlockingConnectionPool's disconnect method to follow the definition in ConnectionPoolInterface (#3802)

We'd like to thank all the contributors who worked on this release!
@scovetta @mengxunQAQ @abrookins @VincentHokie @sobolevn @hunterhogan @luka-mikec @zion-off @peperon @andy-stark-redis @uglide @elena-kolevska @kiryazovi-redis @vladvildanov @petyaslavova

7.0.0b3

07 Oct 18:17

Choose a tag to compare

7.0.0b3 Pre-release
Pre-release

Changes

Main feature introduced in this beta release is a new type of client MultiDBClient. The purpose of this client is a communication with multiple databases that are eventually consistent (Active-Active setup) and handling failures by failover across databases.
More information could be found in docs.

πŸ”₯ Breaking changes

  • Update ping command docstrings and method return type hint (#3789)

πŸ§ͺ Experimental Features

  • Multi-database client implementation (#3784)

🧰 Maintenance

  • [DOC] Add complex chaining example using pipelines with builder pattern (#3774)
  • Fix automation scenarion maint notification (#3788)
  • Add redis 8.4-M01-pre to tested redis versions (#3790)

We'd like to thank all the contributors who worked on this release!
@zion-off @petyaslavova @kiryazovi-redis @vladvildanov