Skip to content

Omit null optional fields from Modal worker payloads#469

Merged
MaxGhenis merged 1 commit intomainfrom
modal-gateway-omit-none-payloads
Apr 26, 2026
Merged

Omit null optional fields from Modal worker payloads#469
MaxGhenis merged 1 commit intomainfrom
modal-gateway-omit-none-payloads

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Use exclude_none=True when the gateway forwards simulation and budget-window payloads to Modal worker functions.
  • Add a regression assertion that omitted optional fields like time_period and data_version are not forwarded as explicit null values.

Why

The main deploy after #468 reached the worker but beta integration still failed because the gateway sent time_period: null. The current worker SimulationOptions rejects None for time_period; omitting absent optional values preserves the worker default behavior.

Testing

  • env -u UV_FROZEN uv run pytest tests/gateway/test_endpoints.py -q
  • env -u UV_FROZEN uv run pytest -q
  • env -u UV_FROZEN uv run --with ruff ruff format --check src

@MaxGhenis MaxGhenis merged commit 6c7d18f into main Apr 26, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the modal-gateway-omit-none-payloads branch April 26, 2026 15:03
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.

1 participant