{"record":{"id":"746045b1c404bda3","repo":"HKUDS/Vibe-Trading","slug":"path-row-row-number-unit-is-blank-and-no-unit","errorCode":null,"errorMessage":"{path} row {row_number}: unit is blank and no unit=... fallback was given","messagePattern":"(.+?) row (.+?): unit is blank and no unit=\\.\\.\\. fallback was given","errorType":"exception","errorClass":"PanelIngestError","httpStatus":null,"severity":"error","filePath":"agent/src/entities/ingest.py","lineNumber":1012,"sourceCode":"\n        row_currency = currency\n        if currency_column is not None:\n            raw_currency = (row.get(currency_column) or \"\").strip()\n            if raw_currency:\n                row_currency = raw_currency\n        if not row_currency:\n            raise PanelIngestError(\n                f\"{path} row {row_number}: currency is blank and no \"\n                \"currency=... fallback was given\"\n            )\n\n        row_unit = unit\n        if unit_column is not None:\n            raw_unit = (row.get(unit_column) or \"\").strip()\n            if raw_unit:\n                row_unit = raw_unit\n        if not row_unit:\n            raise PanelIngestError(\n                f\"{path} row {row_number}: unit is blank and no unit=... \"\n                \"fallback was given\"\n            )\n\n        value = _parse_panel_amount(\n            row.get(resolved[\"value\"], \"\"), path, row_number, decimal_separator\n        )\n\n        metadata: dict[str, Any] = {\n            col: row[col] for col in extra_columns if (row.get(col) or \"\").strip()\n        }\n        metadata[\"source_file\"] = str(path)\n        metadata[\"source_row\"] = row_number\n\n        try:\n            observations.append(\n                PanelObservation(\n                    entity_id=row_entity,","sourceCodeStart":994,"sourceCodeEnd":1030,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/entities/ingest.py#L994-L1030","documentation":"Raised when a long-layout panel row has a blank unit cell and no unit=... fallback was given to load_panel. Units are never defaulted because a numeric value without a unit (shares vs dollars) is ambiguous.","triggerScenarios":"Calling load_panel(layout='long') with a unit_column that is empty for a row and no unit= argument.","commonSituations":"Panels where unit is only stated once, blank trailing rows with partial data, or misnamed unit_column header.","solutions":["Pass unit='...' to load_panel as the fallback","Populate the unit column for every row in the source file","Verify unit_column exactly matches the CSV header"],"exampleFix":"# before\npanel = load_panel('panel.csv', layout='long', unit_column='u')\n# after\npanel = load_panel('panel.csv', layout='long', unit_column='u', unit='millions')","handlingStrategy":"validation","validationCode":"for i, row in enumerate(rows, 1):\n    if not (row.get(unit_col) or '').strip() and unit is None:\n        raise SystemExit(f'row {i}: blank unit, no fallback')","typeGuard":null,"tryCatchPattern":"try:\n    panel = load_panel(...)\nexcept PanelIngestError as e:\n    if 'unit is blank' in str(e): pass unit= or repair file","preventionTips":["Pass unit= fallback for long panels","Ensure unit column fully populated in source"],"tags":["csv","ingest","unit","validation"],"backgroundTag":"missing-required-field","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}