feat: expose Function failure tracebacks (#4861)

Function refresh failures and skipped-row diagnostics lose the traceback
when decoded by the SDK. Expose the server-provided optional `traceback`
on job failure details and Function error records in Rust, Python, and
Node.js, while keeping existing compact error messages.

Responses from older servers remain supported when the field is absent.
Tracebacks may be truncated by the server. The Rust `Error::JobFailed`
variant now stores `Box<JobFailure>` so the added diagnostics do not
enlarge every `Result` error payload.
This commit is contained in:
Xuanwo
2026-11-05 15:16:28 +08:00
committed by GitHub
parent b32afe9794
commit edc49e60e2
14 changed files with 82 additions and 10 deletions
+3
View File
@@ -141,6 +141,7 @@ impl Job {
self.inner.failure().map(|failure| JobFailureInfo {
phase: failure.phase,
message: failure.message,
traceback: failure.traceback,
retryable: failure.retryable,
})
}
@@ -218,5 +219,7 @@ impl From<lancedb::database::JobInfo> for JobInfo {
pub struct JobFailureInfo {
pub phase: Option<String>,
pub message: Option<String>,
/// User-code traceback, possibly truncated by the server.
pub traceback: Option<String>,
pub retryable: Option<bool>,
}
+3
View File
@@ -1530,6 +1530,8 @@ pub struct FunctionErrorRecord {
pub table_version: i64,
pub error_type: String,
pub error_message: String,
/// User-code traceback, possibly truncated by the server.
pub traceback: Option<String>,
pub created_at_millis: i64,
}
@@ -1545,6 +1547,7 @@ impl From<lancedb::function::FunctionErrorRecord> for FunctionErrorRecord {
table_version: record.table_version as i64,
error_type: record.error_type,
error_message: record.error_message,
traceback: record.traceback,
created_at_millis: record.created_at_millis,
}
}