Skip to content

Remove explicit-null serializers for tail extrapolation - #392

Open
amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:remove-tail-extrapolation-null-serializers
Open

amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:remove-tail-extrapolation-null-serializers

Conversation

@amirabbas-jalali-bentley

Copy link
Copy Markdown
Contributor

Description

#354 made the conditioned-simulator and simulation-report payloads always include two keys, sending null when they were unset:

  • distribution.tail_extrapolation
  • distribution.tail_extrapolation.lower

Both tasks used to require these keys to be present. They now treat both as optional, defaulting to null, so the workaround is no longer needed. This PR removes it, so unset values are left out of the request like every other optional field.

Changes

  • Remove the @model_serializer(mode="wrap") overrides from TailExtrapolationParams, DistributionParams and SimulationReportDistribution, along with the imports only they used.
  • Update the payload tests to expect the keys to be left out. Two of them are renamed from ..._sends_null to ..._omits_key.

SimulationReportDistribution.tail_extrapolation keeps the TailExtrapolationParams | None type from #354, so the simulation report still accepts a real tail extrapolation.

No breaking changes. Models, fields and defaults are unchanged. The only difference on the wire is that an unset tail_extrapolation or lower is now left out instead of being sent as null.

Testing

  • Validated the resulting payloads against both tasks' current parameter schemas. All four cases are accepted: no distribution, weights without tail extrapolation, an upper tail only, and both tails.
  • Ran a conditioned simulation followed by a simulation report end to end, once with no tail extrapolation and once with only an upper tail. All four jobs completed.
  • evo-compute tests: 517 passed. ruff check and ruff format --check are clean.

Checklist

  • I have read the contributing guide and the code of conduct

The conditioned simulation and simulation report tasks now treat
`distribution.tail_extrapolation` and `tail_extrapolation.lower` as
optional, so the SDK no longer needs to force explicit nulls for them.

Drop the custom model serializers on `TailExtrapolationParams`,
`DistributionParams` and `SimulationReportDistribution`. Unset values
are now omitted from the request, like every other optional field.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot requested a review from a team as a code owner October 29, 2026 17:57
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