-
[OPIK-6417] [SDK] feat: cascade trace + span comments in opik migrate dataset (#6714)
发布于
2026-05-18 09:51:10 +00:00 - [OPIK-6417] [SDK] feat: cascade trace + span comments in opik migrate dataset
Slice 4 of
opik migrate dataset. The Slice 3 cascade already
copies traces + spans + feedback scores + assertion results, but
comments live asREAD_ONLYon the trace/span Public view -- they
can't ride alongcreate_traces/create_spansand were
silently dropped at the destination.Re-emit them via the dedicated single-comment write endpoints
(POST /v1/private/traces/{id}/comments,
POST /v1/private/spans/{id}/comments) after the destination
trace/span flushes. Each POST is wrapped with the existing
ensure_rest_api_call_respecting_rate_limithelper; order is
preserved by iterating the sourcecommentslist in place so the
destination read order matches.Counters surface on a new
cascade_experiments_summaryaudit
record alongsidetraces_migrated/spans_migrated(additive --
the existingcascade_experimentsaction record shape is
unchanged).Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
- test(e2e): use verifiers for comment round-trip assertions
Extend
verifiers.verify_trace/verify_spanwith an optional
commentskwarg that asserts equality on the source-ordered list
of comment texts. Refactor the cascade-comments e2e to delegate
to the shared verifiers instead of hand-rolling REST polling and
content/order checks.Addresses PR review feedback from baz-reviewer[bot] on PR #6714:
comment text/order is part of theTracePublic.comments/
SpanPublic.commentscontract, so it belongs on the shared
verifier surface (consistent with how the sibling
test_migrate_dataset__evaluate_shape__round_tripstest already
verifies traces viaverifiers.verify_trace).Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com
下载附件