Skip to content

Type hints for chained pipelines #3615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leverage-analytics opened this issue Apr 23, 2025 · 1 comment
Open

Type hints for chained pipelines #3615

leverage-analytics opened this issue Apr 23, 2025 · 1 comment

Comments

@leverage-analytics
Copy link

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.

@petyaslavova
Copy link
Collaborator

Hi @leverage-analytics, thank you for pointing this out! We'll have a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants