Change8

Migrating to Redis Python v7.0.0

Version v7.0.0 introduces 10 breaking changes. This guide details how to update your code.

Released: 10/22/2025

10
Breaking Changes
8
Migration Steps
17
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

EvictionPolicyInterface.cachehelpers.parse_list_to_dictRedisClustersearch.querysearch.commandssearch.aggregationpingcorejsonzrankzrevrankzunionBlockingConnectionPoolMultiDBClientExternalAuthProviderErrorWITHATTRIBSssl_verify_flags_config

Breaking Changes

Issue #1

Added abstract method declaration for the cache property setter in EvictionPolicyInterface, causing existing custom eviction policies to break; implement the setter to fix.

Issue #2

Removed the unused parse_list_to_dict function from helpers; replace any imports/calls with alternative parsing logic.

Issue #3

Removed synchronous context manager support from async RedisCluster; async RedisCluster can no longer be used with a regular 'with' statement, use 'async with' instead.

Issue #4

Improved type annotations for Redis Search/Aggregate modules; update code that relied on previous signatures if type checking fails.

Issue #5

Replaced threading.Lock with threading.RLock throughout the library to avoid deadlocks; custom lock usage may need to be updated.

Issue #6

Updated ping command docstrings and changed its return type hint; adjust code that expects the old return type.

Issue #7

Fixed several *arg type hints in core.py and JSON module commands; update any custom wrappers that depended on previous signatures.

Issue #8

Fixed mypy errors in search module files (query.py, commands.py, aggregation.py); ensure your type hints align with the new definitions.

Issue #9

Added score_cast_func argument to ZRANK, ZREVRANK and ZUNION commands; callers must now provide or accept this new optional parameter.

Issue #10

Changed the timeout type hint in async BlockingConnectionPool from int to float; pass float values for timeout.

Migration Steps

  1. 1
    Implement the cache property setter in any custom EvictionPolicyInterface subclasses.
  2. 2
    Remove or replace usage of the now‑deleted parse_list_to_dict helper.
  3. 3
    Switch from 'with RedisCluster(...)' to 'async with RedisCluster(...)' for async clients.
  4. 4
    Review and adjust code that interacts with the ping command to match the new return type.
  5. 5
    Update calls to ZRANK, ZREVRANK, and ZUNION to handle the new optional score_cast_func argument.
  6. 6
    Pass float values for the timeout parameter when creating an async BlockingConnectionPool.
  7. 7
    If you used threading.Lock directly from the library internals, replace it with threading.RLock or adjust custom synchronization accordingly.
  8. 8
    Run mypy or your type checker to resolve any new type annotation issues in search, core, and JSON modules.

Release Summary

This release adds major new capabilities such as MultiDBClient and maintenance push notification support, but also includes breaking changes that require updates to eviction policy implementations, async RedisCluster usage, and several type‑hint adjustments.

Need More Details?

View the full release notes and all changes for Redis Python v7.0.0.

View Full Changelog