{"id":"76fbd87ce1e2dbf8","repo":"redis/redis-py","slug":"memory-doctor-is-intentionally-not-implemented-in","errorCode":null,"errorMessage":"MEMORY DOCTOR is intentionally not implemented in the client. For more information, see https://redis.io/commands/memory-doctor","messagePattern":"MEMORY DOCTOR is intentionally not implemented in the client\\. For more information, see https://redis\\.io/commands/memory-doctor","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":1868,"sourceCode":"\n    @overload\n    def object(self: SyncClientProtocol, infotype: str, key: KeyT, **kwargs) -> Any: ...\n\n    @overload\n    def object(\n        self: AsyncClientProtocol, infotype: str, key: KeyT, **kwargs\n    ) -> Awaitable[Any]: ...\n\n    def object(self, infotype: str, key: KeyT, **kwargs) -> Any | Awaitable[Any]:\n        \"\"\"\n        Return the encoding, idletime, or refcount about the key\n        \"\"\"\n        return self.execute_command(\n            \"OBJECT\", infotype, key, infotype=infotype, **kwargs\n        )\n\n    def memory_doctor(self, **kwargs) -> None:\n        raise NotImplementedError(\n            \"\"\"\n            MEMORY DOCTOR is intentionally not implemented in the client.\n\n            For more information, see https://redis.io/commands/memory-doctor\n            \"\"\"\n        )\n\n    def memory_help(self, **kwargs) -> None:\n        raise NotImplementedError(\n            \"\"\"\n            MEMORY HELP is intentionally not implemented in the client.\n\n            For more information, see https://redis.io/commands/memory-help\n            \"\"\"\n        )\n\n    @overload\n    def memory_stats(self: SyncClientProtocol, **kwargs) -> dict[str, Any]: ...","sourceCodeStart":1850,"sourceCodeEnd":1886,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/commands/core.py#L1850-L1886","documentation":"memory_doctor is a stub that always raises NotImplementedError. MEMORY DOCTOR returns a human-readable memory diagnostic report intended for redis-cli; it is not structured data, so redis-py does not wrap it as a client method.","triggerScenarios":"Calling r.memory_doctor(). Building a memory-monitoring tool and invoking the obvious method.","commonSituations":"Operator wants programmatic memory diagnostics. Copying redis-cli MEMORY DOCTOR workflow into Python. Enumerating memory_* methods.","solutions":["Use r.execute_command('MEMORY', 'DOCTOR') for the raw text report.","For structured memory stats, use r.memory_stats() or r.memory_usage(key).","Use redis-cli for the human-readable report."],"exampleFix":"# before\nr.memory_doctor()\n# after\nreport = r.execute_command('MEMORY', 'DOCTOR')","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    r.memory_doctor()\nexcept NotImplementedError:\n    report = r.execute_command('MEMORY', 'DOCTOR')","preventionTips":["MEMORY DOCTOR is human-readable — use memory_stats/memory_usage for structured data.","Use execute_command for console-oriented memory subcommands."],"tags":["not-implemented","memory","api-gap"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}