pypi / fakeredis
fakeredis
What changed in fakeredis 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
5 breaking23 new APIs and options8 performance3 behavior and defaults27 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initfakeredis 266 changes
Breaking changes 5
Instances with version 10 no longer share a server with instances with version 1.
Unsorted SORT results are now sorted in scripts and with STORE.
Returns unsorted results in geohash order rather than insertion order.
Does not raise WRONGTYPE for a wrongly typed destination when the source key is missing.
Moves an entry's pending count to the claiming consumer instead of leaving it on the previous owner.
New APIs and options 23
Implements the Redis 8.4 DELEX command.
Implements the Redis 8.4 DIGEST command.
DIGEST requires the new digest extra, installable with pip install "fakeredis[digest]".
Implements the Redis 8.10 HIMPORT DISCARD command.
Implements the Redis 8.10 HIMPORT DISCARDALL command.
Implements the Redis 8.10 HIMPORT PREPARE command.
Implements the Redis 8.10 HIMPORT SET command.
Implements the JSON.NUMPOWBY command.
Async connections report addr, laddr, and fd.
Adds support for the Redis 8.10 BLMOVEM command.
Adds the kividb server type, matching KiviDB 1.0.4's command surface.
Adds support for the Redis 8.10 LMOVEM command.
Adds support for the Redis 8.10 SDIFFCARD command.
Adds support for SORT_RO.
Adds support for the Redis 8.10 SUNIONCARD command.
Adds support for the Redis 8.10 TS.NRANGE command.
Adds support for the Redis 8.10 TS.NREVRANGE command.
Adds support for the Redis 8.10 TS.QUERYLABELS command.
Adds support for the Redis 8.10 TS.READ command.
Accepts the KEEPREF, DELREF, and ACKED reference policies.
Accepts the KEEPREF, DELREF, and ACKED reference policies.
Implements Dragonfly's rate-limiting command, including its time-field rounding, remaining-count truncation, and oversized-request behavior.
Supports redis.setresp(2) and redis.setresp(3); the setting resets to RESP2 for each run and is not exposed when emulating Dragonfly.
Performance 8
Expires keys and hash fields through a heap instead of scanning.
Improves performance for large replies.
Improves Lua table conversion performance.
Lowers per-command and client-construction overhead.
Improves iteration performance for the SCAN family.
Improves SPOP performance.
Improves SRANDMEMBER performance.
Improves performance of stream range reads with COUNT.
Behavior and default changes 3
Each connection gets one client ID and a new one on reconnect.
Matches Dragonfly's command errors, validation, limits, and selected command behavior, including expiry handling, string limits, sorting, copying, geospatial ordering, watched-key dirtiness, scripting, and JSON quirks.
Matches Dragonfly's command replies for numeric results, blocking reads, sorted-set replies, empty streams, unknown lag, pending lookups, and pub/sub namespaces.
Fixes and other changes 27
Pads shorter operands and treats missing keys as empty.
Searches on a missing member return Redis'/Valkey 9's error instead of crashing.
Commands on a missing key return Redis' errors.
Keeps the member when clearing its TTL.
Raises valkey exceptions.
Works for FakeValkey, FakeStrictValkey, and FakeAsyncValkey.
Searches on a missing member return Redis'/Valkey 9's error instead of crashing.
Stops polling when called with timeout=....
Invalidates WATCH like Redis.
Invalidates WATCH like Redis.
Answers RESP2 clients in RESP2.
A single observation now follows Redis 8.10 behavior.
Never reuses deleted IDs and rejects invalid IDs like Redis.
SETID and CREATE, entries-read, and lag follow Redis' rules.
An end ID without a sequence is treated as the whole millisecond.
An end ID without a sequence is treated as the whole millisecond.
An end ID without a sequence is treated as the whole millisecond.
Approximate trimming drops whole nodes.
Fixes ZSCAN while deleting.
On pre-7.0 servers, reports a syntax error before decoding range arguments.
Cancelling a blocking async command no longer returns a connection to the pool with its socket paused, which previously caused later commands to hang.
Lua scripts now receive RESP2-shaped replies from redis.call regardless of the negotiated client protocol, matching Redis.
No longer raises a raw Python KeyError when a pending entry has no live consumer.
Returns the cursor for the next pending-entry scan, and returns 0-0 when the pending list is exhausted.
Honours JUSTID when updating an entry's delivery counter; RETRYCOUNT takes precedence when both are supplied.
Honours RETRYCOUNT when updating an entry's delivery counter; a negative value means it was not given.
Removes entries owned by the deleted consumer and returns how many entries it dropped.