{"record":{"id":"5d2815bcc023d055","repo":"OpenBB-finance/OpenBB","slug":"the-data-is-empty","errorCode":null,"errorMessage":"The data is empty.","messagePattern":"The data is empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/eia/openbb_us_eia/models/petroleum_status_report.py","lineNumber":230,"sourceCode":"                df = df[df.date <= query.end_date]\n\n            df = df.reset_index(drop=True)\n\n            if len(df) > 0:\n                dfs.append(df)\n            else:\n                warn(f\"No data for table: {table}\")\n\n        try:\n            with concurrent.futures.ThreadPoolExecutor() as executor:\n                executor.map(\n                    lambda table: read_excel_file(file, category, table), tables\n                )\n\n            results = concat(dfs)\n\n            if len(results) < 1:\n                raise EmptyDataError(\"The data is empty.\")\n\n            results = results.sort_values(by=[\"date\", \"table\", \"order\"]).replace(\n                {nan: None}\n            )\n\n            return [\n                EiaPetroleumStatusReportData.model_validate(d)\n                for d in results.to_dict(orient=\"records\")\n            ]\n        except Exception as e:  # pylint: disable=broad-except\n            raise OpenBBError(f\"Error transforming the data -> {e}\") from e\n","sourceCodeStart":212,"sourceCodeEnd":242,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/eia/openbb_us_eia/models/petroleum_status_report.py#L212-L242","documentation":"Raised inside the EIA Petroleum Status Report transform stage when all requested tables produced no parseable rows, so the concatenated result is empty. EmptyDataError signals 'valid request, no data' — commonly the chosen tables have no rows in the downloaded workbook or the category's file layout changed and parsing found nothing.","triggerScenarios":"All table parsers warned 'No data for table: X' leaving dfs empty; requesting tables for a week where the report file exists but those sections are blank; pandas/openpyxl version drift breaking sheet parsing so nothing is read.","commonSituations":"Asking for niche tables that are intermittently empty in the report; EIA changing workbook sheet names; date/week parameter combinations for which the report has no data.","solutions":["Try the default tables (e.g. 'stocks' for weekly_estimates) to confirm the file itself parses.","Retry with use_cache=False — a stale cached workbook from a broken download can persist via the alru_cache.","Update the openbb-us-eia provider package; parsing fixes for new workbook layouts land there.","Inspect the downloaded ExcelFile manually (sheet_names, first rows) for the requested tables."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.abstract.fetcher import EmptyDataError\n\ntry:\n    res = await obb.energy.petroleum_status_report(category=cat, table=tbl, provider='eia')\nexcept EmptyDataError:\n    logger.info('No rows for %s/%s — trying default tables', cat, tbl)\n    res = await obb.energy.petroleum_status_report(category=cat, provider='eia', use_cache=False)","preventionTips":["Handle EmptyDataError as 'no data', not as a crash","Retry once with use_cache=False to rule out stale cache","Prefer default tables when iterating over many categories"],"tags":["eia","petroleum-status-report","empty-data","parsing"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}