{"record":{"id":"d54a9494cf980b3e","repo":"run-llama/llama_index","slug":"pandasinstructionparser-has-been-moved-to-llama-i","errorCode":null,"errorMessage":"PandasInstructionParser has been moved to `llama-index-experimental`.\n`pip install llama-index-experimental`\n`from llama_index.experimental.query_engine.pandas import PandasInstructionParser`\nNote that the PandasInstructionParser allows for arbitrary code execution, \nand should be used in a secure environment.","messagePattern":"PandasInstructionParser has been moved to `llama-index-experimental`\\.\n`pip install llama-index-experimental`\n`from llama_index\\.experimental\\.query_engine\\.pandas import PandasInstructionParser`\nNote that the PandasInstructionParser allows for arbitrary code execution, \nand should be used in a secure environment\\.","errorType":"exception","errorClass":"DeprecationWarning","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/query_engine/pandas/output_parser.py","lineNumber":19,"sourceCode":"\"\"\"\nPandas output parser.\n\nDEPRECATED: This class has been moved to `llama-index-experimental`.\n\"\"\"\n\nfrom typing import Any\n\n\nclass PandasInstructionParser:\n    \"\"\"\n    Pandas instruction parser.\n\n    DEPRECATED: This class has been moved to `llama-index-experimental`.\n\n    \"\"\"\n\n    def __init__(self, *args: Any, **kwargs: Any) -> None:\n        raise DeprecationWarning(\n            \"PandasInstructionParser has been moved to `llama-index-experimental`.\\n\"\n            \"`pip install llama-index-experimental`\\n\"\n            \"`from llama_index.experimental.query_engine.pandas import PandasInstructionParser`\\n\"\n            \"Note that the PandasInstructionParser allows for arbitrary code execution, \\n\"\n            \"and should be used in a secure environment.\"\n        )\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/query_engine/pandas/output_parser.py#L1-L26","documentation":"PandasInstructionParser survives in llama-index-core only as a tombstone class: its __init__ unconditionally raises DeprecationWarning pointing to llama-index-experimental, where the pandas query-engine stack moved. The note about arbitrary code execution is deliberate — the parser generates and exec()s pandas code over your DataFrame, so it must only run in trusted contexts.","triggerScenarios":"Instantiating PandasInstructionParser(...) with any arguments after upgrading llama-index-core past the removal — the import still works (the class exists), so the failure appears at construction, typically inside PandasQueryEngine setup.","commonSituations":"Following older llama-index pandas tutorials that import from llama_index.core.query_engine.pandas.output_parser; upgrading llama-index-core without adding the experimental package; CI catching it the first time a notebook builds a PandasQueryEngine.","solutions":["pip install llama-index-experimental and import from llama_index.experimental.query_engine.pandas (the whole PandasQueryEngine + parser live there).","Grep the codebase for 'core.query_engine.pandas' and update every import path.","Treat the exec path as untrusted: only run against DataFrames whose source data is trusted, ideally in a sandboxed/locked-down environment.","If the experimental package is not an option, write your own CustomQueryEngine that prompts for pandas expressions and evaluates them with your own safety checks."],"exampleFix":"# before\nfrom llama_index.core.query_engine.pandas.output_parser import PandasInstructionParser\nparser = PandasInstructionParser(df)  # raises DeprecationWarning\n\n# after\n# pip install llama-index-experimental\nfrom llama_index.experimental.query_engine.pandas import (\n    PandasInstructionParser,\n    PandasQueryEngine,\n)\nengine = PandasQueryEngine(df=df, instruction_parser=PandasInstructionParser(df))","handlingStrategy":"fallback","validationCode":"try:\n    from llama_index.experimental.query_engine.pandas import PandasInstructionParser  # noqa\n    HAS_EXPERIMENTAL = True\nexcept ImportError:\n    HAS_EXPERIMENTAL = False\n\nif not HAS_EXPERIMENTAL:\n    raise SystemExit(\"pip install llama-index-experimental for PandasInstructionParser\")","typeGuard":null,"tryCatchPattern":"try:\n    parser = PandasInstructionParser(df)\nexcept DeprecationWarning:\n    from llama_index.experimental.query_engine.pandas import PandasInstructionParser as ExpParser\n    parser = ExpParser(df)","preventionTips":["Depend on llama-index-experimental explicitly if your code touches pandas/jsonalyze engines.","Update import paths ('core.query_engine.pandas' -> 'experimental.query_engine.pandas') during llama-index upgrades.","Run generated-pandas-code engines only on trusted DataFrames in sandboxed environments — they exec LLM-written code."],"tags":["llama-index","deprecation","migration","pandas","code-execution","security"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}