HKUDS/Vibe-Trading · error · ValuationError
{MODEL_NAME}: driver sequences are empty; at least one proje
Error message
{MODEL_NAME}: driver sequences are empty; at least one projection period is required What it means
_resolve_period_count requires at least one projected period; if all driver sequences have length 0 it raises ValuationError. An empty projection has no meaning for a three-statement model, and letting it through would return an empty artifact that looks like success.
Source
Thrown at agent/src/quantlib/valuation/threestatement.py:501
Returns:
The number of periods to project.
Raises:
ValuationError: If the driver sequences disagree in length, or all are
empty.
"""
lengths = {field: len(drivers[field]) for field in DRIVER_REQUIRED_FIELDS}
distinct = set(lengths.values())
if len(distinct) > 1:
detail = ", ".join(f"{field}={n}" for field, n in lengths.items())
raise ValuationError(
f"{MODEL_NAME}: every driver sequence must share one length (one entry "
f"per projected period); got {detail}"
)
periods = distinct.pop()
if periods < 1:
raise ValuationError(
f"{MODEL_NAME}: driver sequences are empty; at least one projection "
"period is required"
)
return periods
def _project_period(
period: int,
prior_bs: BalanceSheet,
prior_revenue: float,
revenue_growth: float,
gross_margin: float,
opex_pct_revenue: float,
capex_pct_revenue: float,
nwc_pct_revenue: float,
tax_rate: float,
dividend_payout_ratio: float,
depreciation_amortization: float,View on GitHub (pinned to 80ffdda44c)
Solutions
- Check why the driver arrays are empty (usually a date filter or empty upstream table).
- Populate the drivers with at least one period's assumptions.
- Guard with `if not drivers['revenue_growth']: ...` before calling.
Example fix
# before
drivers = {k: [] for k in DRIVER_REQUIRED_FIELDS}
# after
drivers = {"revenue_growth": [0.08], "capex_pct": [0.03], ...} # >= 1 period Defensive patterns
Strategy: validation
Validate before calling
assert all(len(v) >= 1 for v in drivers.values()), 'need >= 1 projection period'
Type guard
def has_periods(drivers) -> bool:
return all(len(v) >= 1 for v in drivers.values()) Try / catch
except ValuationError as e:
if 'at least one projection period' in str(e): skip_scenario() Prevention
- Validate non-empty scenario inputs before looping over configs
- Log driver array lengths in pipeline diagnostics
When it happens
Trigger: Calling project_three_statement with driver lists/arrays of length zero — e.g. slicing a DataFrame to a start date after the end date, or passing empty lists as defaults.
Common situations: Date-range filters that accidentally exclude all rows; parameterized tests looping over empty scenarios; default empty-list config values never populated.
Related errors
- fcff_bridge: ebit forecast is empty; at least one projection
- BalanceSheetError(balance_sheet.period, assets, liabilities,
- {model}: {name} must be a number, got {value!r}
- {model}: {name} must be a finite number, got {numeric!r}
- {MODEL_NAME}: every driver sequence must share one length (o
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/2e4bd1501990c02a.
Report an issue: GitHub.