Skip to content

Return Type Annotation for Streams #2174

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

Closed
ccrvlh opened this issue May 8, 2022 · 2 comments
Closed

Return Type Annotation for Streams #2174

ccrvlh opened this issue May 8, 2022 · 2 comments
Assignees
Labels

Comments

@ccrvlh
Copy link

ccrvlh commented May 8, 2022

Hi, I've been testing Stream for the first time, and have been missing the return type annotation for the commands.

So far we could make everything work with the client.xadd and client.xreadgroup. It seems that it returns a list, the first element being the topic name, and the second element a list of tuples: for each tuple the first element is the message ID, and second element the data.

This is fine and the format is not that important, can be easily parsed. However, I wonder if this format will be consistent regardless of the parameters added to xadd or xreadgroup. It does seem to be the case with the testing we've done so far, but we haven't tried every possible combination. Couldn't find much information on it, looking at the source the annotation is ResponseT which is Any | Awaitable, and there's no information on the docstring either, maybe there's something somewhere else that I've missed?

If there's any guideline on the return, I would be happy to contribute to this, it could be just an improved docstring, or maybe a strongly typed return annotation, or maybe just adding some notes to the Readme.

Thanks!

@JosephSBoyle
Copy link

I would also be happy to work on this. Should a potential PR be submitted to the async branch of redis.py?

Copy link
Contributor

This issue is marked stale. It will be closed in 30 days if it is not updated.

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

No branches or pull requests

3 participants