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

Raised by command_info() (redis/commands/core.py:1315) which is a stub that unconditionally raises NotImplementedError. The method exists to occupy the command surface but deliberately does not implement COMMAND INFO, because the cluster client uses CommandsParser for command metadata internally and the public method was never wired. No arguments are accepted.

Solutions

  1. Send the command directly: r.execute_command("COMMAND", "INFO", "GET")
  2. Use r.command() to get details about all commands, or r.command_list() to enumerate names
  3. Use r.command_getkeysandflags(*args) if you only need the keys of a command

Example fix

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

Strategy: fallback

Validate before calling

# command_info() is intentionally unimplemented; route to execute_command
def command_info(r, *names):
    return r.execute_command("COMMAND", "INFO", *names)

Try / catch

try:
    r.command_info()
except NotImplementedError:
    info = r.execute_command("COMMAND", "INFO", "GET")

Prevention

When it happens

Trigger: Calling r.command_info() or r.command_info("GET"). Any call, with or without arguments, raises immediately.

Common situations: Discovering command metadata programmatically (e.g. to inspect arity or key specs); or assuming command_info mirrors the CLI's COMMAND INFO.

Related errors


AI-assisted analysis of redis/redis-py@6a6b581b48 (2026-08-10). Data as JSON: /api/errors/2c74d2533ca53d05. Report an issue: GitHub.

Appendix: 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 6a6b581b48)