{"record":{"id":"6d7179421c4e122f","repo":"zylon-ai/private-gpt","slug":"we-don-t-have-any-result","errorCode":null,"errorMessage":"We don't have any result","messagePattern":"We don't have any result","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/tabular/pandasai_service.py","lineNumber":297,"sourceCode":"        if session is None:\n            return None\n\n        return PandasAISandboxAdapter(client=session)\n\n    def _execute_chat(\n        self,\n        query: str,\n        smart_dataframes: list[DataFrame | VirtualDataFrame],\n        sandbox: Sandbox | None,\n    ) -> BaseResponse:\n        \"\"\"Execute the PandasAI chat call, managing sandbox lifecycle if needed.\"\"\"\n        try:\n            if sandbox is not None:\n                sandbox.start()\n\n            result = self._pandas_ai.chat(query, *smart_dataframes, sandbox=sandbox)\n            if not result:\n                raise ValueError(\"We don't have any result\")\n            return result\n        finally:\n            if sandbox is not None:\n                sandbox.stop()\n\n    def _run_analysis_sync(\n        self,\n        query: str,\n        smart_dataframes: list[DataFrame | VirtualDataFrame],\n        sandbox: Sandbox | None,\n    ) -> PandasAIOutput:\n        \"\"\"Synchronous analysis execution with sandbox management.\"\"\"\n        try:\n            result = self._execute_chat(query, smart_dataframes, sandbox)\n        except Exception as e:\n            logger.error(f\"Error during PandasAI analysis: {e}\")\n            result = ErrorResponse(error=str(e))\n","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/tabular/pandasai_service.py#L279-L315","documentation":"Raised in _chat_with_sandbox when self._pandas_ai.chat(...) returns a falsy result (None, empty). The sandbox is started/stopped around the call in try/finally, so this fires after a chat call that completed without raising but produced nothing — typically the pipeline short-circuited (no code generated, filtering rejected the output, or the underlying library returned None).","triggerScenarios":"pandasai chat returns None because code generation or execution was skipped/rejected internally; an empty conversation context or missing smart_dataframes causes an early None return; version of pandasai whose chat returns Optional[BaseResponse].","commonSituations":"Misconfigured LLM for pandasai silently failing; empty or malformed train dataframes; prompts the pipeline's safety filters block; API changes in the pandasai version returning a different response shape.","solutions":["Enable debug logging for the pandasai layer to see why chat returned nothing (code generation step is usual culprit).","Verify smart_dataframes are non-empty and schemas are attached before calling chat.","Check the pandasai LLM configuration (key, model) — silent auth failures often end in None.","Retry once; transient LLM failures can yield empty results.","Treat as a user-facing 'analysis produced no result' case rather than crashing."],"exampleFix":"# before\nresult = self._pandas_ai.chat(query, *smart_dataframes, sandbox=sandbox)\nif not result:\n    raise ValueError(\"We don't have any result\")\n\n# after (retry once, then degrade gracefully)\nresult = self._pandas_ai.chat(query, *smart_dataframes, sandbox=sandbox)\nif not result:\n    logger.warning(\"Empty analysis result, retrying once\")\n    result = self._pandas_ai.chat(query, *smart_dataframes, sandbox=sandbox)\nif not result:\n    raise ValueError(\"We don't have any result\")","handlingStrategy":"retry","validationCode":"def inputs_valid(query: str, dfs: list) -> bool:\n    return bool(query.strip()) and all(df is not None for df in dfs)","typeGuard":null,"tryCatchPattern":"try:\n    result = service._chat_with_sandbox(query, dfs, sandbox)\nexcept ValueError as e:\n    if \"We don't have any result\" in str(e):\n        result = service._chat_with_sandbox(query, dfs, sandbox)  # one retry\n    else:\n        raise","preventionTips":["Validate query and dataframes before chat","Verify the pandasai LLM credentials/model work (silent auth failure ends in None)","Enable debug logs on the pandasai layer to catch skipped code generation"],"tags":["pandasai","empty-result","llm-output","chat"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}