HKUDS/Vibe-Trading · error · PanelIngestError
{path} row {row_number}: unit is blank and no unit=... fallb
Error message
{path} row {row_number}: unit is blank and no unit=... fallback was given What it means
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.
Source
Thrown at agent/src/entities/ingest.py:1012
row_currency = currency
if currency_column is not None:
raw_currency = (row.get(currency_column) or "").strip()
if raw_currency:
row_currency = raw_currency
if not row_currency:
raise PanelIngestError(
f"{path} row {row_number}: currency is blank and no "
"currency=... fallback was given"
)
row_unit = unit
if unit_column is not None:
raw_unit = (row.get(unit_column) or "").strip()
if raw_unit:
row_unit = raw_unit
if not row_unit:
raise PanelIngestError(
f"{path} row {row_number}: unit is blank and no unit=... "
"fallback was given"
)
value = _parse_panel_amount(
row.get(resolved["value"], ""), path, row_number, decimal_separator
)
metadata: dict[str, Any] = {
col: row[col] for col in extra_columns if (row.get(col) or "").strip()
}
metadata["source_file"] = str(path)
metadata["source_row"] = row_number
try:
observations.append(
PanelObservation(
entity_id=row_entity,View on GitHub (pinned to 80ffdda44c)
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
Example fix
# before
panel = load_panel('panel.csv', layout='long', unit_column='u')
# after
panel = load_panel('panel.csv', layout='long', unit_column='u', unit='millions') Defensive patterns
Strategy: validation
Validate before calling
for i, row in enumerate(rows, 1):
if not (row.get(unit_col) or '').strip() and unit is None:
raise SystemExit(f'row {i}: blank unit, no fallback') Try / catch
try:
panel = load_panel(...)
except PanelIngestError as e:
if 'unit is blank' in str(e): pass unit= or repair file Prevention
- Pass unit= fallback for long panels
- Ensure unit column fully populated in source
When it happens
Trigger: Calling load_panel(layout='long') with a unit_column that is empty for a row and no unit= argument.
Common situations: Panels where unit is only stated once, blank trailing rows with partial data, or misnamed unit_column header.
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
- {path}: unknown column mapping {field_name!r}; mappable fiel
- {path}: mapped column {source_name!r} for field {field_name!
- {path} row {row_number}: amount is blank. A missing amount m
- {path}: layout={layout!r} needs unit=... -- a wide table has
- {path}: layout={layout!r} needs at least one column besides
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/746045b1c404bda3.
Report an issue: GitHub.