fix(exceptions): surface trace ID and underlying reason in FailedUpload#593
fix(exceptions): surface trace ID and underlying reason in FailedUpload#593kannwism wants to merge 1 commit into
Conversation
FailedUpload now carries an optional trace_id, populated from RapidataError responses, and FailedUploadException's rendering prints it next to each item. Datapoint-level failures caused by asset upload errors now inherit the underlying asset errors' reasons (and trace IDs) instead of the opaque "One or more required assets failed to upload" placeholder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: RapidPoseidon <poseidon@rapidata.ai>
Code Review — PR #593: surface trace ID and underlying reason in FailedUploadOverviewThis PR solves a real UX problem: previously, users hitting asset-upload failures saw an opaque Correctness
# asset_to_datapoints entries for failed assets are still intact here because
# _find_ready_datapoints only removes entries on *successful* completion.
affected = asset_to_datapoints.get(asset_failure.item, set())Multiple trace IDs joined into a single string In Design / Duplication
A forward-compatible option would be to add a new
Test CoverageThe test plan lists manual smoke tests but no automated ones. Given the grouping and rendering logic touches several code paths, the following would be valuable additions:
These are unit-testable in isolation and would prevent regressions as the pipeline evolves. Minor / Nits
SummaryThe change is well-motivated and the core logic is correct. The main asks before merge:
The multiple-trace-ID string concern is low-priority given the diagnostic-only use case, but worth tracking if |
Summary
FailedUploadnow carries an optionaltrace_id, populated fromRapidataErrorresponses, so the backend trace that produced the failure is preserved end-to-end.FailedUploadException.__str__prints[trace_id=…]next to each affected item. Grouping by reason is unchanged (the new field is rendered per item, not folded into the grouping key) so identical failures still cluster.One or more required assets failed to uploadplaceholder._rapidata_dataset._collect_and_return_resultsaccepts the asset-levelFailedUploads and maps them back to the blocked datapoints viaasset_to_datapoints.Motivation
Before this change, a user hitting an asset-upload failure saw a generic message with no way to correlate it to the backend trace, so support tickets had to be opened blind.
RapidataErroralready extractsdetails.traceIdfor top-level errors — this change just stops dropping it on the way through the upload pipeline.Test plan
uv run pyright src/rapidata/rapidata_client— clean (0/0/0).FailedUpload.from_exceptionpopulatestrace_idforRapidataError, leavesNoneotherwise.FailedUploadExceptionrenders[trace_id=…]per item with two different trace IDs grouped under one reason.trace_idstill renders without the suffix.🔗 Session: https://session-8649337b.poseidon.rapidata.internal/
🤖 Generated with Claude Code