{"record":{"id":"92bbdc20a0b10825","repo":"redis/redis-py","slug":"explaincli-will-not-be-implemented","errorCode":null,"errorMessage":"EXPLAINCLI will not be implemented.","messagePattern":"EXPLAINCLI will not be implemented\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"redis/commands/search/commands.py","lineNumber":1423,"sourceCode":"        if isinstance(res, Pipeline):\n            return res\n\n        return self._parse_results(HYBRID_CMD, res, **options)\n\n    def explain(\n        self,\n        query: Union[str, Query],\n        query_params: Optional[Dict[str, Union[str, int, float, bytes]]] = None,\n    ):\n        \"\"\"Returns the execution plan for a complex query.\n\n        For more information see `FT.EXPLAIN <https://redis.io/commands/ft.explain>`_.\n        \"\"\"  # noqa\n        args, query_text = self._mk_query_args(query, query_params=query_params)\n        return self.execute_command(EXPLAIN_CMD, *args)\n\n    def explain_cli(self, query: Union[str, Query]):  # noqa\n        raise NotImplementedError(\"EXPLAINCLI will not be implemented.\")\n\n    def aggregate(\n        self,\n        query: Union[AggregateRequest, Cursor],\n        query_params: Optional[Dict[str, Union[str, int, float, bytes]]] = None,\n    ):\n        \"\"\"\n        Issue an aggregation query.\n\n        ### Parameters\n\n        **query**: This can be either an `AggregateRequest`, or a `Cursor`\n\n        An `AggregateResult` object is returned. You can access the rows from\n        its `rows` property, which will always yield the rows of the result.\n\n        For more information see `FT.AGGREGATE <https://redis.io/commands/ft.aggregate>`_.\n        \"\"\"  # noqa","sourceCodeStart":1405,"sourceCodeEnd":1441,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/search/commands.py#L1405-L1441","documentation":"Raised by explain_cli() (redis/commands/search/commands.py:1423) as NotImplementedError - the method exists for API compatibility but is deliberately not implemented. There is no FT.EXPLAINCLI surface exposed by this client; use explain() (FT.EXPLAIN) instead.","triggerScenarios":"Calling index.explain_cli(query). Any direct call to this method raises unconditionally.","commonSituations":"Migrating from an older client or another library that exposed EXPLAINCLI, or assuming parity with the redis-cli EXPLAINCLI command.","solutions":["Use index.explain(query) which issues FT.EXPLAIN and returns the plan.","Remove any explain_cli calls from your code; the method will never succeed.","If you need CLI-style output, format the result of explain() yourself."],"exampleFix":"# before\nplan = index.explain_cli(query)\n# after\nplan = index.explain(query)","handlingStrategy":"fallback","validationCode":"def safe_explain(index, query):\n    return index.explain(query)  # never call explain_cli","typeGuard":"null","tryCatchPattern":"try:\n    plan = index.explain_cli(query)\nexcept NotImplementedError:\n    plan = index.explain(query)","preventionTips":["Never call explain_cli - it is unconditionally NotImplementedError.","Use explain() (FT.EXPLAIN) for the query plan.","Remove explain_cli references during migrations."],"tags":["search","explain","notimplementederror","redisearch"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}