mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Record a failure when the selection yields no export rows 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4220ce4bf0
commit
42201e42c5
1 changed files with 12 additions and 0 deletions
|
|
@ -91,6 +91,18 @@ class ScenarioExportOrchestrator:
|
|||
named_sheets.append((self._scenarios.name_for(scenario_id), sheet))
|
||||
row_count += len(sheet.rows)
|
||||
|
||||
if row_count == 0:
|
||||
# No Property had a default Plan under any requested Scenario (model
|
||||
# A) — a recorded failure, never an empty workbook emailed (ADR-0065).
|
||||
raise SubTaskFailure(
|
||||
"the scenario export selection produced no exportable rows",
|
||||
details={
|
||||
"portfolio_id": portfolio_id,
|
||||
"scenario_ids": list(scenario_ids),
|
||||
"property_count": len(property_ids),
|
||||
},
|
||||
)
|
||||
|
||||
data = render_workbook(named_sheets)
|
||||
key = f"{self._key_prefix}/{export_name}.xlsx"
|
||||
self._exports.put_object(key, data)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue