fix(workflow): use input config variants in MultiRankingWorkflow#686
Merged
Merged
Conversation
MultiRankingWorkflow built the request-side IPairMakerConfig / IRankingConfig unions from the read-side ...Model... variant classes, which those unions do not accept, so create_ranking_order raised a pydantic ValidationError at construction time. Swap to the matching non-Model variants (IPairMakerConfigOnlinePairMakerConfig, IPairMakerConfigFullPermutationPairMakerConfig, IRankingConfigBradleyTerryRankingConfig). The variants have identical fields, so the serialized payload is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
ReviewOverviewFixes a nightly integration test failure in Correctness
Code quality / conventions
Test coverage
Risk
Overall: correct, well-scoped fix with a clear root-cause writeup. Only suggestion is adding a lightweight unit test for |
LinoGiger
approved these changes
Jul 18, 2026
LinoGiger
marked this pull request as ready for review
July 18, 2026 11:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The nightly Run SDK Orders test (failing run) fails on the ranking order step:
Root cause
The generated client carries two parallel one-of unions:
IPairMakerConfig(request)IPairMakerConfigFullPermutationPairMakerConfig,IPairMakerConfigOnlinePairMakerConfigIPairMakerConfigModel(read)...ModelFullPermutation...Model,...ModelOnline...ModelIOrderWorkflowInputGroupedRankingWorkflowInput.pairMakerConfig/.rankingConfigexpect the non-Modelrequest unions, butMultiRankingWorkflow.__init__instantiated the...Model...read-side classes, which the request union rejects at construction. The OpenAPI client itself is up to date — only this hand-written wrapper was stale, and nothing type-checks the union membership, so only the integration run caught it.Fix
Swap to the matching request-side variants in
_multi_ranking_workflow.py:IPairMakerConfigModelFullPermutationPairMakerConfigModel→IPairMakerConfigFullPermutationPairMakerConfigIPairMakerConfigModelOnlinePairMakerConfigModel→IPairMakerConfigOnlinePairMakerConfigIRankingConfigModelBradleyTerryRankingConfigModel→IRankingConfigBradleyTerryRankingConfigThe variants have identical fields, so the serialized payload is byte-for-byte unchanged:
Verification
blackclean,pyright src/rapidata/rapidata_client→ 0 errors.🔗 Session: https://session-0deec1d3.poseidon.rapidata.internal/