HKUDS/Vibe-Trading · error · CashFlowIngestError

{path} row {row_number}: date is blank

Error message

{path} row {row_number}: date is blank

What it means

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.

Source

Thrown at agent/src/entities/ingest.py:248

    row_number: int,
) -> date:
    """Parse a date cell, using an explicit format when one is supplied.

    Args:
        raw: Raw cell text.
        date_format: ``strptime`` format, or ``None`` to require ISO-8601.
        path: File path, used only for error messages.
        row_number: 1-based data row number, used only for error messages.

    Returns:
        The parsed ``datetime.date``.

    Raises:
        CashFlowIngestError: If the cell is blank or does not parse.
    """
    text = (raw or "").strip()
    if not text:
        raise CashFlowIngestError(f"{path} row {row_number}: date is blank")
    if date_format:
        try:
            return datetime.strptime(text, date_format).date()
        except ValueError as exc:
            raise CashFlowIngestError(
                f"{path} row {row_number}: date {raw!r} does not match "
                f"date_format={date_format!r}"
            ) from exc
    try:
        return normalize_date(text)
    except ValueError as exc:
        raise CashFlowIngestError(
            f"{path} row {row_number}: date {raw!r} is not ISO-8601 "
            "(YYYY-MM-DD). Pass date_format=... explicitly; regional formats "
            "are not guessed because day-first and month-first cannot be told "
            "apart from the data."
        ) from exc

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Inspect the reported row and fill in or remove the blank-date row
  2. Verify the columns mapping maps 'date' to the real date header and that the delimiter is correct
  3. Delete preamble/footnote rows from the export before loading

Example fix

# before (row: ,100.00,USD)
load_cashflows('flows.csv')
# after (row: 2024-01-05,100.00,USD)
load_cashflows('flows.csv')
Defensive patterns

Strategy: validation

Validate before calling

blank = [i for i, r in enumerate(rows, 2) if not (r.get(date_col) or '').strip()]
if blank:
    raise ValueError(f'blank dates at rows {blank}')

Type guard

def has_blank_dates(rows, date_col) -> bool:
    return any(not (r.get(date_col) or '').strip() for r in rows)

Try / catch

try:
    load_cashflows(p)
except CashFlowIngestError as e:
    if 'date is blank' in str(e):
        fix_or_remove_row(extract_row_number(e)); load_cashflows(p)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/d5c26a8d8f3b623b. Report an issue: GitHub.