{"record":{"id":"713e8f39b3b37cff","repo":"HKUDS/Vibe-Trading","slug":"path-layout-layout-r-needs-metric-a-wi","errorCode":null,"errorMessage":"{path}: layout={layout!r} needs metric=... -- a wide table has nowhere to put a metric label; every cell already shares its row's and column's identity","messagePattern":"(.+?): layout=(.+?) needs metric=\\.\\.\\. -- a wide table has nowhere to put a metric label; every cell already shares its row's and column's identity","errorType":"exception","errorClass":"PanelIngestError","httpStatus":null,"severity":"error","filePath":"agent/src/entities/ingest.py","lineNumber":1092,"sourceCode":"        rows: Row dicts as read by ``_read_rows``.\n        layout: ``\"wide_dates_rows\"`` or ``\"wide_entities_rows\"``.\n        metric: The single metric label every cell in this file represents.\n        currency: The currency for every value in this file.\n        unit: The unit for every value in this file.\n        date_format: ``strptime`` format for date cells/headers.\n        decimal_separator: Declared decimal separator, or ``None`` to infer.\n\n    Returns:\n        An ``EntityPanel``.\n\n    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)}\"","sourceCodeStart":1074,"sourceCodeEnd":1110,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/entities/ingest.py#L1074-L1110","documentation":"load_panel refuses wide layouts without an explicit metric= argument because a wide table's cells share their row's and column's identity — there is no column to carry a metric label, so the library cannot invent one.","triggerScenarios":"Calling load_panel with a wide file (or layout='wide_dates_rows'/'wide_entities_rows') without passing metric='...'.","commonSituations":"Switching a pipeline from long-format exports to wide-format spreadsheets and reusing the old load_panel call.","solutions":["Pass metric='revenue' (or whatever the table measures) to load_panel","Or export/reshape the data to long layout with a metric column and keep layout='long'"],"exampleFix":"# before\npanel = load_panel('wide.csv')  # wide layout inferred\n# after\npanel = load_panel('wide.csv', metric='revenue')","handlingStrategy":"validation","validationCode":"if inferred_or_given_layout != 'long' and metric is None:\n    raise SystemExit('wide layouts require metric=')","typeGuard":null,"tryCatchPattern":"except PanelIngestError as e:\n    if 'needs metric=' in str(e): retry with metric='revenue'","preventionTips":["Always pass metric= when loading wide tables"],"tags":["ingest","panel","wide-layout","metric"],"backgroundTag":"missing-required-argument","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}