{"record":{"id":"a327ea316f0d20e0","repo":"OpenBB-finance/OpenBB","slug":"error-transforming-the-data-e","errorCode":null,"errorMessage":"Error transforming the data -> {e}","messagePattern":"Error transforming the data -> (.+?)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/eia/openbb_us_eia/models/petroleum_status_report.py","lineNumber":241,"sourceCode":"                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":223,"sourceCodeEnd":242,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/eia/openbb_us_eia/models/petroleum_status_report.py#L223-L242","documentation":"Catch-all wrapper around the whole transform stage of the EIA Petroleum Status Report: any exception while parsing tables, concatenating, sorting, or validating rows (including the empty-data case) is re-raised as OpenBBError with this prefix. The original exception is chained (from e), so the text after '->' identifies the real failure.","triggerScenarios":"Any of: EmptyDataError from empty results (error 327); KeyError from missing sheet/table names; pandas errors from sort_values on missing columns; pydantic validation errors on malformed records; the TypeError from a non-ExcelFile payload (error 326).","commonSituations":"EIA workbook layout changes breaking column expectations; outdated provider version against a new report format; corrupted cached downloads; invalid table/category combos that slipped past param validation.","solutions":["Inspect the chained cause — run with the full traceback or catch OpenBBError and print .original / __cause__ to see the underlying exception.","Update the openbb-us-eia provider to the latest version for current workbook parsing.","Clear the cached file by retrying with use_cache=False.","If the cause is EmptyDataError, follow error 327's guidance; if validation, simplify to the default table set."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    res = await obb.energy.petroleum_status_report(category=cat, table=tbl, provider='eia')\nexcept OpenBBError as e:\n    cause = repr(e.__cause__ or e.original)\n    if 'EmptyDataError' in cause:\n        return []  # no data is not an error for the pipeline\n    if 'api_key' in str(e):\n        raise RuntimeError('Fix EIA credentials') from e\n    raise","preventionTips":["Always inspect the chained cause (__cause__/original), not just the wrapper text","Keep the openbb-us-eia provider current when EIA changes workbook layouts"],"tags":["eia","petroleum-status-report","wrapper","transform","parsing"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}