Skip to content
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

Documentation of ping() is not clear #2717

Open
codebude opened this issue May 6, 2024 · 0 comments
Open

Documentation of ping() is not clear #2717

codebude opened this issue May 6, 2024 · 0 comments

Comments

@codebude
Copy link

codebude commented May 6, 2024

The issue refers to: https://redis-py.readthedocs.io/en/stable/commands.html#redis.commands.core.CoreCommands.ping


The documentation of the ping() method is unclear or confusing. According to the documentation, the return value is:

Union[Awaitable, Any]

In practice, however, the callback logic always returns a bool by default. See:

I suggest changing the return-type in the documentation to:

Union[Awaitable, bool]

It would also be helpful if the mode of operation were also mentioned in the description. Because the current text only refers to the redis.io PING documentation, which says that the return value is a string with the value “PONG”:

Ping the Redis server

For more information see https://redis.io/commands/ping

I would suggest something like:

Ping the Redis server

Send PING1 command to server and returns boolean True if the server's response equals "PONG"2.

1For more information on the underlying ping command see https://redis.io/commands/ping
2This default behaviour can be overwritten by setting a custom callback.

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

1 participant