Skip to content

Documentation of ping() is not clear #1853

@codebude

Description

@codebude

The issue refers to: https://redis.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.

Note: This is a follow-up of redis/redis-doc#2717 which wasn't resolved yet, but may not be handled any more as the repository is marked as obsolete.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions