Change8

v6.0.0b1

Breaking Changes
📦 redis-pythonView on GitHub →
5 breaking5 features🐛 10 fixes4 deprecations🔧 18 symbols

Summary

The release introduces new hash commands, load‑balancing configuration, jittered exponential backoff, and several bug fixes, while removing RedisGears/RedisGraph support, updating FCALL typing, moving ClusterParser exceptions, and switching the default search dialect to version 2.

⚠️ Breaking Changes

  • Support for the RedisGears module has been removed. Code that imports or uses RedisGears will fail; remove the module usage or migrate to alternative functionality.
  • Support for the RedisGraph module has been removed. Remove any imports or commands targeting RedisGraph.
  • FCALL command signatures have been updated to follow PEP 484 typing. Calls that relied on the previous loosely-typed signatures may raise type errors; update your code to match the new type hints.
  • ClusterParser exception classes have been moved to the BaseParser class. Catching the old ClusterParser exceptions will no longer work; import and catch the exceptions from BaseParser instead.
  • The client now defaults to query dialect 2 for search commands (e.g., FT.AGGREGATE, FT.SEARCH). This can change query results; configure the client dialect explicitly if you need the previous behavior.

Migration Steps

  1. Remove any usage of RedisGears and RedisGraph modules or replace them with supported alternatives.
  2. Update code that catches ClusterParser exceptions to import and catch the corresponding exceptions from BaseParser.
  3. If your application relies on the previous query dialect, explicitly set the client dialect to the desired version via the client configuration.
  4. Replace the deprecated 'read_from_replicas' setting with the new 'load_balancing_strategy' option in cluster client configurations.
  5. Review FCALL command calls and adjust them to match the new PEP 484 type signatures.
  6. Check for any usage of the deprecated get_connection arguments and remove them.
  7. If you used FT.CONFIG GET/SET or the search module config_set/config_get commands, migrate to the newer configuration APIs.

✨ New Features

  • Added hash commands with expiration support: HGETDEL, HGETEX, and HSETEX.
  • Introduced load_balancing_strategy configuration for cluster clients as a replacement for read_from_replicas.
  • Implemented exponential backoff with jitter for retry logic.
  • Provided an option to suppress exceptions when exiting a lock context after the lock has expired.
  • Added force_master_ip support to the asynchronous Sentinel client.

🐛 Bug Fixes

  • Fixed the search module dropindex function to avoid sending an invalid third parameter and updated pipeline infrastructure.
  • Fixed async cluster pipeline execution when the client is created with cluster_error_retry_attempts=0.
  • Corrected client_list handling for multiple client IDs.
  • Added a valid Exception type to the except clause in ClusterPipeline.
  • Stopped decreasing the created connections count when releasing a connection not owned by the pool (fixes #2832).
  • Fixed a TimeoutError during ClusterPipeline that could make the client unrecoverable (issue #3130).
  • Fixed connection health checks for protocol versions other than 2 when authentication credentials and a health-check interval are configured.
  • Fixed an AttributeError that occurred when client.get_default_node() returned None.
  • Added TimeoutError handling in get_connection().
  • Prevented a stack trace on process exit from Client.__del__().

Affected Symbols

⚡ Deprecations

  • The 'read_from_replicas' configuration on cluster clients is deprecated in favor of the new load_balancing_strategy option.
  • Unused arguments in connection pool's get_connection functions are deprecated and will be removed.
  • FT.CONFIG GET and FT.CONFIG SET commands in the search module are deprecated; use the newer configuration APIs.
  • Search module config_set and config_get commands are deprecated; migrate to the recommended alternatives.