Skip to content

Commit 907cfc8

Browse files
committed
Preserve null budget-window output fields
1 parent 2f059ab commit 907cfc8

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

projects/policyengine-api-simulation/src/modal/gateway/responses.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def batch_status_response(response: BudgetWindowBatchStatusResponse):
3737
return AcceptedResponse(payload)
3838
if response.status == "failed":
3939
return ServerErrorResponse(payload)
40+
if response.status == "complete":
41+
return JSONResponse(status_code=200, content=payload)
4042
return response
4143

4244

projects/policyengine-api-simulation/tests/gateway/test_endpoints.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,13 @@ def test__given_batch_state__then_poll_returns_completed_response(
733733
assert response.json()["status"] == "complete"
734734
assert response.json()["result"]["years"] == ["2026", "2027"]
735735
assert "annualImpacts" not in response.json()["result"]
736+
output = response.json()["result"]["outputsByYear"]["2026"]
737+
assert output["poverty_by_race"] is None
738+
assert output["wealth_decile"] is None
739+
assert output["intra_wealth_decile"] is None
740+
assert output["constituency_impact"] is None
741+
assert output["local_authority_impact"] is None
742+
assert output["cliff_impact"] is None
736743
assert response.json()["result"]["totals"]["budgetaryImpact"] == 32
737744
assert response.json()["run_id"] == "batch-run-123"
738745

0 commit comments

Comments
 (0)