Skip to content

Fix budget-window batch worker gateway imports#477

Merged
anth-volk merged 3 commits intomainfrom
fix/budget-window-batch-model-import
May 5, 2026
Merged

Fix budget-window batch worker gateway imports#477
anth-volk merged 3 commits intomainfrom
fix/budget-window-batch-model-import

Conversation

@anth-volk
Copy link
Copy Markdown
Contributor

Fixes #476

Summary

  • Make src.modal.gateway package initialization side-effect free so model-only imports do not load FastAPI endpoints inside the heavy simulation Modal image.
  • Add a regression test proving src.modal.gateway.models does not import src.modal.gateway.endpoints or fastapi.
  • Add a beta-only post-deploy simulation integration test that submits and polls a two-year budget-window batch through the deployed gateway.

Testing

  • uv run ruff format --check ../policyengine-apis-integ/tests/simulation/test_budget_window.py
  • uv run ruff check ../policyengine-apis-integ/tests/simulation/test_budget_window.py
  • uv run pytest tests/simulation/test_budget_window.py --collect-only -q
  • uv run pytest tests/gateway/test_package_imports.py tests/test_budget_window_context.py tests/test_budget_window_batch.py -q

@anth-volk anth-volk marked this pull request as ready for review May 5, 2026 18:00
@anth-volk anth-volk merged commit 1313a58 into main May 5, 2026
4 checks passed
@anth-volk anth-volk deleted the fix/budget-window-batch-model-import branch May 5, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Budget-window batch worker fails importing gateway models in Modal simulation image

1 participant