{"record":{"id":"2e4bd1501990c02a","repo":"HKUDS/Vibe-Trading","slug":"model-name-driver-sequences-are-empty-at-least","errorCode":null,"errorMessage":"{MODEL_NAME}: driver sequences are empty; at least one projection period is required","messagePattern":"(.+?): driver sequences are empty; at least one projection period is required","errorType":"validation","errorClass":"ValuationError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/valuation/threestatement.py","lineNumber":501,"sourceCode":"\n    Returns:\n        The number of periods to project.\n\n    Raises:\n        ValuationError: If the driver sequences disagree in length, or all are\n            empty.\n    \"\"\"\n    lengths = {field: len(drivers[field]) for field in DRIVER_REQUIRED_FIELDS}\n    distinct = set(lengths.values())\n    if len(distinct) > 1:\n        detail = \", \".join(f\"{field}={n}\" for field, n in lengths.items())\n        raise ValuationError(\n            f\"{MODEL_NAME}: every driver sequence must share one length (one entry \"\n            f\"per projected period); got {detail}\"\n        )\n    periods = distinct.pop()\n    if periods < 1:\n        raise ValuationError(\n            f\"{MODEL_NAME}: driver sequences are empty; at least one projection \"\n            \"period is required\"\n        )\n    return periods\n\n\ndef _project_period(\n    period: int,\n    prior_bs: BalanceSheet,\n    prior_revenue: float,\n    revenue_growth: float,\n    gross_margin: float,\n    opex_pct_revenue: float,\n    capex_pct_revenue: float,\n    nwc_pct_revenue: float,\n    tax_rate: float,\n    dividend_payout_ratio: float,\n    depreciation_amortization: float,","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/valuation/threestatement.py#L483-L519","documentation":"_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.","triggerScenarios":"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.","commonSituations":"Date-range filters that accidentally exclude all rows; parameterized tests looping over empty scenarios; default empty-list config values never populated.","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."],"exampleFix":"# before\ndrivers = {k: [] for k in DRIVER_REQUIRED_FIELDS}\n# after\ndrivers = {\"revenue_growth\": [0.08], \"capex_pct\": [0.03], ...}  # >= 1 period","handlingStrategy":"validation","validationCode":"assert all(len(v) >= 1 for v in drivers.values()), 'need >= 1 projection period'","typeGuard":"def has_periods(drivers) -> bool:\n    return all(len(v) >= 1 for v in drivers.values())","tryCatchPattern":"except ValuationError as e:\n    if 'at least one projection period' in str(e): skip_scenario()","preventionTips":["Validate non-empty scenario inputs before looping over configs","Log driver array lengths in pipeline diagnostics"],"tags":["valuation","three-statement","empty-input"],"backgroundTag":"empty-input","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}