HKUDS/Vibe-Trading · error · ValuationError
{model}: name is required and cannot be blank, got {name!r}
Error message
{model}: name is required and cannot be blank, got {name!r} What it means
Company dataclasses (_require_name, invoked from __post_init__) reject blank or non-string names because every report and deduplication step keys off the company name. Constructing a peer/target with name='' or ' ' (or a non-str) fails immediately at object construction.
Source
Thrown at agent/src/quantlib/valuation/comps.py:589
)
equity = float(enterprise_value) - delta
return EVBridgeResult(
direction="ev_to_equity",
equity_value=equity,
enterprise_value=float(enterprise_value),
total_debt=float(total_debt),
cash_and_equivalents=float(cash_and_equivalents),
minority_interest=minority_interest,
preferred_stock=preferred_stock,
investments_in_associates=investments_in_associates,
omitted_components=omitted,
)
def _require_name(name: str, model: str) -> str:
"""Reject a blank company name -- every report keys off it."""
if not isinstance(name, str) or not name.strip():
raise ValuationError(f"{model}: name is required and cannot be blank, got {name!r}")
return name
def _require_eps_basis(eps_basis: str, model: str) -> str:
"""Reject an EPS basis that is not one of the two this module recognises."""
if eps_basis not in EPS_BASES:
raise ValuationError(
f"{model}: eps_basis must be one of {EPS_BASES}, got {eps_basis!r}"
)
return eps_basis
@dataclass(frozen=True)
class PeerCompany:
"""One comparable company's raw inputs for the EV bridge and multiple matrix.
Attributes:
name: Identifier (ticker or short name), used in every report andView on GitHub (pinned to 80ffdda44c)
Solutions
- Validate the name field in your ingestion code before constructing the dataclass.
- Provide a fallback identifier (ticker) with a documented basis when the display name is missing.
- Fail fast on empty rows upstream: skip records with blank names and log them.
Example fix
# before
peer = CompPeer(name=row.get('name', ''), ...)
# after
name = (row.get('name') or row['ticker']).strip()
if not name:
continue
peer = CompPeer(name=name, ...) Defensive patterns
Strategy: validation
Validate before calling
name = (name or '').strip()
if not name:
raise ValueError('company name required') Type guard
def valid_name(name):
return isinstance(name, str) and bool(name.strip()) Try / catch
except ValuationError as e:
if 'name is required' in str(e):
skip_row() Prevention
- Skip blank-name rows during ingestion
- Default names to ticker with a documented rule
When it happens
Trigger: Building a comps peer or target dataclass with an empty/whitespace name, or a name that is None/int because a dict key was missed.
Common situations: Programmatic peer construction from rows where the name column is empty; CSVs with missing ticker/name cells; default '' values leaking through.
Related errors
- an assumption must be named
- title is required
- thesis is required
- memory name must not be empty or whitespace-only
- {model}: eps_basis must be one of {EPS_BASES}, got {eps_basi
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/c5eacdfb70bfe359.
Report an issue: GitHub.