HKUDS/Vibe-Trading · error · PanelIngestError
row : unit is blank and no unit=... fallback was given
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.
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 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
- : layout= needs at least one column besides the first…
- : layout= needs unit=... -- a wide table has no unit…
- : mapped column for field is not in the file. Columns…
- row : amount is blank. A missing amount must be fixed at…
- row : is blank
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/746045b1c404bda3.
Report an issue: GitHub.
Appendix: 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)