v6.0.0
Breaking Changes📦 redis-pythonView on GitHub →
⚠ 9 breaking✨ 3 features🐛 11 fixes⚡ 5 deprecations🔧 16 symbols
Summary
Redis‑py 6.0.0 introduces new hash and Sentinel features, experimental VectorSet support, and several breaking changes such as stricter SSL hostname checks, mandatory retry objects for cluster clients, and removal of legacy modules.
⚠️ Breaking Changes
- Default ssl_check_hostname is now True; when using Sentinel to connect to a master you must set ssl_check_hostname=False if the Sentinel does not return hostnames.
- require_full_coverage argument default changed to true for the synchronous Cluster client; code relying on false default should explicitly set require_full_coverage=False.
- Cluster clients now require a retry object; if omitted a default ExponentialWithJitterBackoff retry is created. The 'cluster_error_retry_attempts' argument is deprecated and ignored when a retry is supplied, and for AsyncClusterClient the 'connection_error_retry_attempts' argument has been removed.
- Standalone clients now default to 3 retries with ExponentialWithJitterBackoff; adjust custom retry logic if different behavior is needed.
- The 'charset' and 'errors' parameters have been removed from Redis initialization; remove these arguments from Redis(...) calls.
- Support for the RedisGears module has been removed; any code using RedisGears will fail.
- Support for the RedisGraph module has been removed; any code using RedisGraph will fail.
- ClusterParser exception classes have been moved to BaseParser; import paths need to be updated.
- The default search query dialect is now 2, which may change query results; configure the client dialect explicitly to retain previous behavior.
Migration Steps
- If you connect to a master via Sentinel and encounter hostname errors, set ssl_check_hostname=False when creating the client.
- Review any usage of the 'require_full_coverage' argument for sync Cluster clients; set it explicitly if you need the previous false default.
- Provide a retry object when constructing Cluster clients, or adjust code that relied on 'cluster_error_retry_attempts' (now deprecated) and remove 'connection_error_retry_attempts' from AsyncClusterClient calls.
- Remove 'charset' and 'errors' parameters from Redis initialization calls.
- Update imports of ClusterParser exception classes to use BaseParser.
- If your application depends on RedisGears or RedisGraph modules, remove or replace that functionality as support has been dropped.
- If you rely on the default search query dialect, explicitly set the desired dialect on the client to maintain previous behavior.
✨ New Features
- Added hash commands with expiration options: HGETDEL, HGETEX, and HSETEX.
- Added an option to suppress exceptions when exiting a lock context manager after lock expiration.
- Async Sentinel client now supports force_master_ip.
🐛 Bug Fixes
- Handled special values when converting response data to list (issue #3573).
- Fixed infinitely recursive health checks.
- Corrected search module dropindex function to avoid sending an invalid third parameter and updated pipeline infrastructure.
- Fixed async cluster pipeline execution when client was created with cluster_error_retry_attempts=0.
- Fixed client_list handling with multiple client IDs.
- Added a valid Exception type to except clause in ClusterPipeline.
- Resolved TimeoutError during ClusterPipeline that made the client unrecoverable.
- Fixed connection health check for protocol != 2 when auth credentials are provided and health check interval is set.
- Fixed AttributeError when client.get_default_node() returns None.
- Added TimeoutError handling in get_connection().
- Avoided stacktrace on process exit in Client.__del__().
Affected Symbols
Redis.ssl_check_hostnameClusterClient.require_full_coverageClusterClient.retryClusterClient.cluster_error_retry_attemptsAsyncClusterClient.connection_error_retry_attemptsRedis.__init__.charsetRedis.__init__.errorsRedisGearsRedisGraphClusterParserBaseParserSearchClient.dialectHGETDELHGETEXHSETEXVectorSet
⚡ Deprecations
- 'cluster_error_retry_attempts' argument is deprecated in favor of providing a retry object.
- Default retry strategy for standalone clients (3 retries with ExponentialWithJitterBackoff) is now the standard; custom retry configurations should be reviewed.
- Old RediSearch 1.0 commands are deprecated.
- FT.CONFIG GET and FT.CONFIG SET commands in the search module are deprecated.
- Search module config_set and config_get commands are deprecated.