Type hints for chained pipelines
Author: leverage-analyticsCreated Apr 23, 2025Updated Sep 10, 2026
I'm using redis-py version 5.2.1.
The documentation shows that calls to a pipeline can be chained. Here's an example from the documentation:
pipe = r.pipeline()
pipe.set("a", "a value").set("b", "b value").get("a").execute()The type hints appear to be set incorrectly on the methods to return the pipeline object.
It seems that since Pipeline inherits from Redis whichin turn inherts from RedisModuleCommands, CoreCommands, and SentinelCommands, the types for chained Pipeline commands aren't working because the inherited commands return their "normal" responses as typed.
The same thing is happening in the asyncio module.
Source: redis/redis-py