{"record":{"id":"09423661365dedc8","repo":"run-llama/llama_index","slug":"pandas-is-required-for-this-function-please-insta-094236","errorCode":null,"errorMessage":"pandas is required for this function. Please install it with `pip install pandas`.","messagePattern":"pandas is required for this function\\. Please install it with `pip install pandas`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/node_recency.py","lineNumber":65,"sourceCode":"    \"\"\"\n\n    top_k: int = 1\n    date_key: str = \"date\"\n\n    @classmethod\n    def class_name(cls) -> str:\n        return \"FixedRecencyPostprocessor\"\n\n    def _postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n    ) -> List[NodeWithScore]:\n        \"\"\"Postprocess nodes.\"\"\"\n        try:\n            import pandas as pd\n        except ImportError:\n            raise ImportError(\n                \"pandas is required for this function. Please install it with `pip install pandas`.\"\n            )\n\n        if query_bundle is None:\n            raise ValueError(\"Missing query bundle in extra info.\")\n\n        # sort nodes by date\n        node_dates = pd.to_datetime(\n            [node.node.metadata[self.date_key] for node in nodes]\n        )\n        sorted_node_idxs = np.flip(node_dates.argsort())\n        sorted_nodes = [nodes[idx] for idx in sorted_node_idxs]\n\n        return sorted_nodes[: self.top_k]\n\n\nDEFAULT_QUERY_EMBEDDING_TMPL = (\n    \"The current document is provided.\\n\"","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/node_recency.py#L47-L83","documentation":"Error \"pandas is required for this function. Please install it with `pip install pandas`.\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/node_recency.py:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install pandas: `pip install pandas`."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}