{"record":{"id":"d5c26a8d8f3b623b","repo":"HKUDS/Vibe-Trading","slug":"path-row-row-number-date-is-blank","errorCode":null,"errorMessage":"{path} row {row_number}: date is blank","messagePattern":"(.+?) row (.+?): date is blank","errorType":"exception","errorClass":"CashFlowIngestError","httpStatus":null,"severity":"error","filePath":"agent/src/entities/ingest.py","lineNumber":248,"sourceCode":"    row_number: int,\n) -> date:\n    \"\"\"Parse a date cell, using an explicit format when one is supplied.\n\n    Args:\n        raw: Raw cell text.\n        date_format: ``strptime`` format, or ``None`` to require ISO-8601.\n        path: File path, used only for error messages.\n        row_number: 1-based data row number, used only for error messages.\n\n    Returns:\n        The parsed ``datetime.date``.\n\n    Raises:\n        CashFlowIngestError: If the cell is blank or does not parse.\n    \"\"\"\n    text = (raw or \"\").strip()\n    if not text:\n        raise CashFlowIngestError(f\"{path} row {row_number}: date is blank\")\n    if date_format:\n        try:\n            return datetime.strptime(text, date_format).date()\n        except ValueError as exc:\n            raise CashFlowIngestError(\n                f\"{path} row {row_number}: date {raw!r} does not match \"\n                f\"date_format={date_format!r}\"\n            ) from exc\n    try:\n        return normalize_date(text)\n    except ValueError as exc:\n        raise CashFlowIngestError(\n            f\"{path} row {row_number}: date {raw!r} is not ISO-8601 \"\n            \"(YYYY-MM-DD). Pass date_format=... explicitly; regional formats \"\n            \"are not guessed because day-first and month-first cannot be told \"\n            \"apart from the data.\"\n        ) from exc\n","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/entities/ingest.py#L230-L266","documentation":"Raised by _parse_date when the date cell is empty after stripping. Dates are mandatory for cash flows, and unlike amounts there is no 'fix at source' alternative, so the loader refuses the row rather than guessing a date.","triggerScenarios":"load_cashflows/load_panel reads a row whose date column cell is '' or whitespace, e.g. ',100.00,USD'. Also reachable through _looks_like_date and _parse_panel_date paths.","commonSituations":"Comment/summary rows left in exports; misaligned columns due to wrong delimiter so the date column reads blank; a mapped date column pointing at an empty column; sparse manual spreadsheets.","solutions":["Inspect the reported row and fill in or remove the blank-date row","Verify the columns mapping maps 'date' to the real date header and that the delimiter is correct","Delete preamble/footnote rows from the export before loading"],"exampleFix":"# before (row: ,100.00,USD)\nload_cashflows('flows.csv')\n# after (row: 2024-01-05,100.00,USD)\nload_cashflows('flows.csv')","handlingStrategy":"validation","validationCode":"blank = [i for i, r in enumerate(rows, 2) if not (r.get(date_col) or '').strip()]\nif blank:\n    raise ValueError(f'blank dates at rows {blank}')","typeGuard":"def has_blank_dates(rows, date_col) -> bool:\n    return any(not (r.get(date_col) or '').strip() for r in rows)","tryCatchPattern":"try:\n    load_cashflows(p)\nexcept CashFlowIngestError as e:\n    if 'date is blank' in str(e):\n        fix_or_remove_row(extract_row_number(e)); load_cashflows(p)","preventionTips":["Scan for blank date cells before load","Verify column mapping/delimiter so dates land in the date column","Strip comment/summary rows from exports"],"tags":["csv","date-parsing","blank-value"],"backgroundTag":"missing-required-field","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}