HKUDS/Vibe-Trading · error · PanelIngestError

{path}: layout={layout!r} needs currency=... -- a wide table

Error message

{path}: layout={layout!r} needs currency=... -- a wide table has no currency column, and currency is never defaulted

What it means

Wide layouts have no currency column, and currency is never defaulted, so load_panel requires an explicit currency= argument when the inferred/explicit layout is wide.

Source

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

        decimal_separator: Declared decimal separator, or ``None`` to infer.

    Returns:
        An ``EntityPanel``.

    Raises:
        PanelIngestError: If ``metric``/``currency``/``unit`` is missing, the
            file has fewer than two columns, a column header in
            ``wide_entities_rows`` is not a usable date, or a cell fails to
            parse.
    """
    if metric is None:
        raise PanelIngestError(
            f"{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"
        )
    if currency is None:
        raise PanelIngestError(
            f"{path}: layout={layout!r} needs currency=... -- a wide table "
            "has no currency column, and currency is never defaulted"
        )
    if unit is None:
        raise PanelIngestError(
            f"{path}: layout={layout!r} needs unit=... -- a wide table has "
            "no unit column, and unit is never defaulted"
        )
    if len(header) < 2:
        raise PanelIngestError(
            f"{path}: layout={layout!r} needs at least one column besides "
            f"the first (row-label) column. Columns present: {', '.join(header)}"
        )

    row_label_column = header[0]
    series_columns = list(header[1:])

    column_dates: dict[str, date] = {}

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Pass currency='USD' to load_panel
  2. Or convert the file to long layout with a currency column

Example fix

# before
panel = load_panel('wide.csv', metric='revenue')
# after
panel = load_panel('wide.csv', metric='revenue', currency='USD')
Defensive patterns

Strategy: validation

Validate before calling

if layout_is_wide and currency is None: currency = 'USD'  # decide explicitly before calling

Try / catch

except PanelIngestError as e:
    if 'needs currency=' in str(e): retry with explicit currency

Prevention

When it happens

Trigger: Calling load_panel on a wide table (or with layout='wide_*') without currency='...'.

Common situations: Wide spreadsheets of financial data where currency was implicit in a title cell or filename.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — 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/830a29a11fd686f5. Report an issue: GitHub.