{"record":{"id":"48e57b1732c91188","repo":"run-llama/llama_index","slug":"pandasqueryengine-has-been-moved-to-llama-index-e","errorCode":null,"errorMessage":"PandasQueryEngine has been moved to `llama-index-experimental`.\n`pip install llama-index-experimental`\n`from llama_index.experimental.query_engine import PandasQueryEngine`\nNote that the PandasQueryEngine allows for arbitrary code execution, \nand should be used in a secure environment.","messagePattern":"PandasQueryEngine has been moved to `llama-index-experimental`\\.\n`pip install llama-index-experimental`\n`from llama_index\\.experimental\\.query_engine import PandasQueryEngine`\nNote that the PandasQueryEngine allows for arbitrary code execution, \nand should be used in a secure environment\\.","errorType":"exception","errorClass":"DeprecationWarning","httpStatus":null,"severity":"warning","filePath":"llama-index-core/llama_index/core/indices/struct_store/pandas.py","lineNumber":16,"sourceCode":"\"\"\"\nPandas csv structured store.\n\nDEPRECATED: Please use :class:`PandasQueryEngine` in `llama-index-experimental` instead.\n\"\"\"\n\nfrom typing import Any\n\n\nclass PandasIndex:\n    def __init__(\n        self,\n        *args: Any,\n        **kwargs: Any,\n    ) -> None:\n        raise DeprecationWarning(\n            \"PandasQueryEngine has been moved to `llama-index-experimental`.\\n\"\n            \"`pip install llama-index-experimental`\\n\"\n            \"`from llama_index.experimental.query_engine import PandasQueryEngine`\\n\"\n            \"Note that the PandasQueryEngine allows for arbitrary code execution, \\n\"\n            \"and should be used in a secure environment.\"\n        )\n\n\n# Legacy\nGPTPandasIndex = PandasIndex\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/struct_store/pandas.py#L1-L27","documentation":"PandasIndex (and GPTPandasIndex) were moved out of llama-index-core into llama-index-experimental because PandasQueryEngine generates and executes arbitrary pandas code. The stub class raises DeprecationWarning in __init__ so old imports keep working but instantiation fails with instructions for the new package.","triggerScenarios":"Calling PandasIndex(...) or GPTPandasIndex(...) on llama-index-core after the removal (roughly v0.10.44+); running old notebooks/scripts built before the move.","commonSituations":"Upgrading llama-index past the deprecation boundary; tutorials showing the old core import path; CI suddenly failing after a dependency bump.","solutions":["pip install llama-index-experimental and change the import to from llama_index.experimental.query_engine import PandasQueryEngine","Use PandasQueryEngine(df, ...) instead of building a PandasIndex directly","Run it only in a sandboxed/secure environment — it executes LLM-generated code by design"],"exampleFix":"# before\nfrom llama_index.core.indices.struct_store.pandas import PandasIndex, GPTPandasIndex\nindex = PandasIndex(df=df)  # raises DeprecationWarning\n\n# after\npip install llama-index-experimental\nfrom llama_index.experimental.query_engine import PandasQueryEngine\nquery_engine = PandasQueryEngine(df=df)","handlingStrategy":"fallback","validationCode":"try:\n    from llama_index.experimental.query_engine import PandasQueryEngine\n    HAS_EXPERIMENTAL = True\nexcept ImportError:\n    HAS_EXPERIMENTAL = False\n\nif not HAS_EXPERIMENTAL:\n    raise RuntimeError('pip install llama-index-experimental for PandasQueryEngine')","typeGuard":"def pandas_engine_available() -> bool:\n    try:\n        from llama_index.experimental.query_engine import PandasQueryEngine  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    index = PandasIndex(df=df)\nexcept DeprecationWarning as e:\n    if 'llama-index-experimental' in str(e):\n        from llama_index.experimental.query_engine import PandasQueryEngine\n        query_engine = PandasQueryEngine(df=df)\n    else:\n        raise","preventionTips":["After any llama-index upgrade, grep for imports under core that moved to integration/experimental packages","Run PandasQueryEngine only in sandboxed environments since it executes generated code"],"tags":["llama-index","pandas","deprecation","migration","code-execution"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}