redis/redis-py · error · NotImplementedError

COMMAND INFO is intentionally not implemented in the client.

Error message

COMMAND INFO is intentionally not implemented in the client.

What it means

command_info is a stub that always raises NotImplementedError. redis-py intentionally does not implement COMMAND INFO as a client method; it is available via the generic execute_command('COMMAND', 'INFO', ...) escape hatch if needed. This is by design, not a bug.

Source

Thrown at redis/commands/core.py:1315

    def command(self: SyncClientProtocol, **kwargs) -> dict[str, dict[str, Any]]: ...

    @overload
    def command(
        self: AsyncClientProtocol, **kwargs
    ) -> Awaitable[dict[str, dict[str, Any]]]: ...

    def command(
        self, **kwargs
    ) -> dict[str, dict[str, Any]] | Awaitable[dict[str, dict[str, Any]]]:
        """
        Returns dict reply of details about all Redis commands.

        For more information, see https://redis.io/commands/command
        """
        return self.execute_command("COMMAND", **kwargs)

    def command_info(self, **kwargs) -> None:
        raise NotImplementedError(
            "COMMAND INFO is intentionally not implemented in the client."
        )

    @overload
    def command_count(self: SyncClientProtocol, **kwargs) -> int: ...

    @overload
    def command_count(self: AsyncClientProtocol, **kwargs) -> Awaitable[int]: ...

    def command_count(self, **kwargs) -> int | Awaitable[int]:
        return self.execute_command("COMMAND COUNT", **kwargs)

    @overload
    def command_list(
        self: SyncClientProtocol,
        module: str | None = None,
        category: str | None = None,
        pattern: str | None = None,

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Use r.execute_command('COMMAND', 'INFO', *command_names) to call it directly on the wire.
  2. Use r.command() for full command metadata, or r.command_list() for the command list.
  3. If you only need the count of commands, use r.command_count().

Example fix

# before
r.command_info('GET', 'SET')
# after
r.execute_command('COMMAND', 'INFO', 'GET', 'SET')
Defensive patterns

Strategy: fallback

Validate before calling

# check before calling — command_info is always a stub
import inspect
if 'NotImplementedError' in inspect.getsource(type(r).command_info):
    result = r.execute_command('COMMAND', 'INFO', 'GET')

Try / catch

try:
    r.command_info()
except NotImplementedError:
    r.execute_command('COMMAND', 'INFO', *cmds)

Prevention

When it happens

Trigger: Calling r.command_info() directly. Auto-discovering methods on a client object and invoking command_info. Copying from redis-cli usage where COMMAND INFO is a normal command.

Common situations: Developer expects a 1:1 mapping between redis-cli commands and python methods. IDE autocomplete suggests command_info but it raises. Building a command-metadata tool and calling the obvious method name.

Related errors


AI-assisted analysis of redis/redis-py@da03cdc7e8 (2026-08-04). Data as JSON: /data/errors/2c74d2533ca53d05.json. Report an issue: GitHub.