fix(results): read canonical info.type in to_pandas#684
Merged
Conversation
The aggregator emits the task type as info.type (v4.0.0), but RapidataResults.to_pandas() read info.orderType — a name the server does not emit. Every current Compare/Ranking result therefore hit the "Results are old" warning and fell through to the generic flattener, losing the A_/B_ asset columns. Read info.type as canonical with info.orderType as a read fallback so both current and older payloads route to the compare-aware path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: lino <68745352+LinoGiger@users.noreply.github.com>
ReviewSmall, well-scoped fix. The root cause (reading a field the aggregator never emits) is clearly diagnosed in the PR description, and the fallback approach ( Code quality
Potential edge case (minor, not blocking)
Test coverage
Scope
Overall: looks correct and safe to merge. Only suggestion is to add a regression test in a fast follow-up. |
LinoGiger
marked this pull request as ready for review
July 17, 2026 14:15
LinoGiger
approved these changes
Jul 17, 2026
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 result aggregator (
rapidata-evaluator) emits the task type asinfo.type(schemaversion4.0.0), and the docs match. ButRapidataResults.to_pandas()readinfo.orderType— a field the server does not emit anywhere in v4 (it exists only in this reader; not in the evaluator, OpenAPI schemas, docs, or any example).Consequences for every current Compare/Ranking result:
orderTypeisNone→ prints the misleading "Results are old and Order type is not specified" warning on brand-new results.to_pandas()silently falls through to the generic flattener and loses theA_/B_asset columns.Reported from integration testing: SDK 3.16.5, Python 3.12, Compare task.
Fix
Client-side tolerant reader:
_task_type()reads canonicaltypewithorderTypeas a read fallback, so results generated before the rename still route correctly. No server change — this fixes every result already in the wild without re-aggregation.Verified locally: a v4 (
type: Compare) payload now yieldsA_/B_columns; anorderTypepayload still works; the warning fires only when the type is genuinely absent.pyrightandblackclean.Scope
Minimal fix so the broken parsing can be merged now. A typed result-model design (typed accessors over the raw dict) is being drafted separately and coordinated with the sibling raw-vs-weighted winner fields work.
🔗 Session: https://node-25c37285.poseidon.rapidata.internal/