{"record":{"id":"7b61d082e5bf2bc1","repo":"HKUDS/Vibe-Trading","slug":"path-layout-layout-r-needs-unit-a-wide","errorCode":null,"errorMessage":"{path}: layout={layout!r} needs unit=... -- a wide table has no unit column, and unit is never defaulted","messagePattern":"(.+?): layout=(.+?) needs unit=\\.\\.\\. -- a wide table has no unit column, and unit is never defaulted","errorType":"exception","errorClass":"PanelIngestError","httpStatus":null,"severity":"error","filePath":"agent/src/entities/ingest.py","lineNumber":1103,"sourceCode":"    Raises:\n        PanelIngestError: If ``metric``/``currency``/``unit`` is missing, the\n            file has fewer than two columns, a column header in\n            ``wide_entities_rows`` is not a usable date, or a cell fails to\n            parse.\n    \"\"\"\n    if metric is None:\n        raise PanelIngestError(\n            f\"{path}: layout={layout!r} needs metric=... -- a wide table has \"\n            \"nowhere to put a metric label; every cell already shares its \"\n            \"row's and column's identity\"\n        )\n    if currency is None:\n        raise PanelIngestError(\n            f\"{path}: layout={layout!r} needs currency=... -- a wide table \"\n            \"has no currency column, and currency is never defaulted\"\n        )\n    if unit is None:\n        raise PanelIngestError(\n            f\"{path}: layout={layout!r} needs unit=... -- a wide table has \"\n            \"no unit column, and unit is never defaulted\"\n        )\n    if len(header) < 2:\n        raise PanelIngestError(\n            f\"{path}: layout={layout!r} needs at least one column besides \"\n            f\"the first (row-label) column. Columns present: {', '.join(header)}\"\n        )\n\n    row_label_column = header[0]\n    series_columns = list(header[1:])\n\n    column_dates: dict[str, date] = {}\n    if layout == \"wide_entities_rows\":\n        for column_name in series_columns:\n            try:\n                column_dates[column_name] = _parse_panel_date(\n                    column_name, date_format, path, row_number=0","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/entities/ingest.py#L1085-L1121","documentation":"Wide layouts have no unit column, and unit is never defaulted, so load_panel requires an explicit unit= argument for wide tables.","triggerScenarios":"Calling load_panel on a wide table (or with layout='wide_*') without unit='...'.","commonSituations":"Wide tables where units live in a footnote or header text rather than a column.","solutions":["Pass unit='millions' (etc.) to load_panel","Or reshape to long layout with a unit column"],"exampleFix":"# before\npanel = load_panel('wide.csv', metric='revenue', currency='USD')\n# after\npanel = load_panel('wide.csv', metric='revenue', currency='USD', unit='millions')","handlingStrategy":"validation","validationCode":"if layout_is_wide and unit is None: unit = 'millions'  # set explicitly","typeGuard":null,"tryCatchPattern":"except PanelIngestError as e:\n    if 'needs unit=' in str(e): retry with explicit unit","preventionTips":["Document units in config so wide loads always pass unit="],"tags":["ingest","panel","wide-layout","unit"],"backgroundTag":"missing-required-argument","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}