{"record":{"id":"a3a9440421b1f7cf","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-found-in-the-dataframe","errorCode":null,"errorMessage":"No data was found in the DataFrame.","messagePattern":"No data was found in the DataFrame\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/obbject_extensions/charting/openbb_charting/charts/price_performance.py","lineNumber":51,"sourceCode":"        \"three_month\",\n        \"six_month\",\n        \"ytd\",\n        \"one_year\",\n        \"two_year\",\n        \"three_year\",\n        \"four_year\",\n        \"five_year\",\n    ]\n\n    df = DataFrame()\n    chart_df = DataFrame()\n\n    if \"symbol\" in data.columns:\n        data = data.set_index(\"symbol\")\n    chart_cols = []\n\n    if len(data) == 0:\n        raise ValueError(\"No data was found in the DataFrame.\")\n\n    data = data.drop_duplicates(keep=\"first\")\n\n    for col in cols:\n        if col in data.columns and data[col].notnull().any():\n            df[col.replace(\"_\", \" \").title() if col != \"ytd\" else col.upper()] = data[\n                col\n            ].apply(lambda x: round(x * 100, 4) if x is not None else None)\n\n    if df.empty:\n        raise ValueError(f\"No columns matching, {cols}, were found in the data.\")\n\n    chart_df = df.T\n    chart_cols = chart_df.columns.to_list()\n\n    if \"limit\" in kwargs and isinstance(kwargs.get(\"limit\"), int):\n        limit = kwargs.pop(\"limit\", 10)\n        chart_df = chart_df.head(limit)  # type: ignore","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/obbject_extensions/charting/openbb_charting/charts/price_performance.py#L33-L69","documentation":"The price-performance bar chart converts the OBBject results to a DataFrame indexed by symbol and checks row count; zero rows means the provider returned no performance data at all, and the ValueError 'No data was found in the DataFrame.' is raised before any column matching occurs.","triggerScenarios":"Calling chart/equity/price/price_performance (or .charting() on a price-performance result) when the provider returned zero symbols; empty symbol list passed to the endpoint; provider outage returning an empty payload.","commonSituations":"Batch requests where all tickers were invalid/delisted; market-data API quota exhausted returning empty bodies; upstream provider errors swallowed into empty results.","solutions":["Check res.results is non-empty before charting","Verify the symbols are valid and the provider has coverage (try obb.equity.price.price_performance(symbol='AAPL') alone)","Retry after confirming provider status/credentials in the user account"],"exampleFix":"# before\nres = obb.equity.price.price_performance(symbol='BADTICKER')\nres.charting()\n\n# after\nres = obb.equity.price.price_performance(symbol='AAPL')\nassert res.results, 'no performance data returned'\nres.charting()","handlingStrategy":"validation","validationCode":"res = obb.equity.price.price_performance(symbol=symbols)\nassert res.results, 'provider returned no performance rows'","typeGuard":"def has_rows(res) -> bool:\n    return bool(res.results) and len(res.to_df()) > 0","tryCatchPattern":"try:\n    res.charting()\nexcept ValueError as e:\n    if 'No data was found' in str(e):\n        logging.warning('empty price-performance payload for %s', symbols)","preventionTips":["Check res.results before charting","Test single liquid symbols first","Monitor provider status/credentials for silent empty payloads"],"tags":["openbb","charting","price-performance","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}