redis/redis-py · error · NotImplementedError

LATENCY GRAPH is intentionally not implemented in the client

Error message

LATENCY GRAPH is intentionally not implemented in the client. For more information, see https://redis.io/commands/latency-graph

What it means

latency_graph is a stub that always raises NotImplementedError. LATENCY GRAPH returns an ASCII-art graph meant for the redis-cli console; it has no structured value for a programmatic client, so redis-py does not implement it.

Source

Thrown at redis/commands/core.py:1731

        This function is best used within the redis-cli.

        For more information, see https://redis.io/commands/latency-doctor
        """
        raise NotImplementedError(
            """
            LATENCY DOCTOR is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/latency-doctor
            """
        )

    def latency_graph(self):
        """Raise a NotImplementedError, as the client will not support LATENCY GRAPH.
        This function is best used within the redis-cli.

        For more information, see https://redis.io/commands/latency-graph.
        """
        raise NotImplementedError(
            """
            LATENCY GRAPH is intentionally not implemented in the client.

            For more information, see https://redis.io/commands/latency-graph
            """
        )

    @overload
    def lolwut(
        self: SyncClientProtocol, *version_numbers: Union[str, float], **kwargs
    ) -> bytes | str: ...

    @overload
    def lolwut(
        self: AsyncClientProtocol, *version_numbers: Union[str, float], **kwargs
    ) -> Awaitable[bytes | str]: ...

    def lolwut(self, *version_numbers: Union[str, float], **kwargs) -> (

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Use r.execute_command('LATENCY', 'GRAPH') for the raw ASCII output.
  2. For numeric latency series, use r.latency_history(event) and render your own graph.
  3. Use redis-cli for the built-in ASCII graph.

Example fix

# before
r.latency_graph()
# after
ascii_graph = r.execute_command('LATENCY', 'GRAPH')
Defensive patterns

Strategy: fallback

Try / catch

try:
    r.latency_graph()
except NotImplementedError:
    graph = r.execute_command('LATENCY', 'GRAPH')

Prevention

When it happens

Trigger: Calling r.latency_graph() directly. Enumerating latency_* methods for a monitoring tool.

Common situations: Operator wants a latency visualization and calls the method expecting a data structure. Copying redis-cli LATENCY GRAPH workflow into Python.

Related errors


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