mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
fix: expose Function metadata in SDK job listings (#5096)
Expose affected columns, pinned Function name/version, completion time,
duration and failure summaries on `JobInfo` in the Rust, Python and
TypeScript SDKs. Values come from the listing response, so callers can
inspect recent computed column refreshes without opening every job.
Older servers keep optional values absent; measured zero durations stay
zero.
```python
latest = next((info for info in db.list_jobs(table="events", job_type="function_refresh") if "embedding" in info.columns), None)
if latest is not None:
print(latest.function_name, latest.function_version, latest.duration_millis)
if latest.failure is not None:
print(latest.failure.message)
```
Duration is creation-to-completion wall time, including queueing and
pauses. Adds listing response coverage across SDKs and documents the
metadata contract, including SQL `SHOW JOBS EXTENDED` for the expanded
listing. Plain `SHOW JOBS` preserves its original columns. Local builds
and tests were skipped as requested.
The dependency advisory check also fails on current main because
`libsais-rs 0.2.0` is yanked ([main
job](https://github.com/lancedb/lancedb/actions/runs/44470513618/job/135378545456));
this PR does not change dependencies.
This changes the public shape of Rust and TypeScript `JobInfo`: callers
constructing summaries must supply the added fields (including
TypeScript `columns`). TypeScript table filtering remains a separate
concern; the guide now shows its client-side selection and namespace
limitation alongside Python and Rust server-side filters.
Refs ENT-3903.
This commit is contained in:
@@ -288,6 +288,18 @@ pub struct JobInfo {
|
||||
pub state: String,
|
||||
/// When the job was created, in milliseconds since the epoch.
|
||||
pub created_at_millis: i64,
|
||||
/// Terminal timestamp in milliseconds since the epoch, when known.
|
||||
pub completed_at_millis: Option<i64>,
|
||||
/// Creation-to-completion wall time, including queueing and pauses.
|
||||
pub duration_millis: Option<i64>,
|
||||
/// Affected columns; empty when unavailable or not column-scoped.
|
||||
pub columns: Vec<String>,
|
||||
/// Pinned Function catalog name, with namespace segments joined by `$`.
|
||||
pub function_name: Option<String>,
|
||||
/// Pinned Function version, when known.
|
||||
pub function_version: Option<String>,
|
||||
/// Durable failure summary, when available.
|
||||
pub failure: Option<JobFailureInfo>,
|
||||
/// Structured lifecycle, queue, pause, and job-type-specific progress.
|
||||
#[napi(ts_type = "Record<string, unknown>")]
|
||||
pub progress: serde_json::Value,
|
||||
@@ -304,6 +316,12 @@ impl From<lancedb::database::JobInfo> for JobInfo {
|
||||
job_type: info.job_type,
|
||||
state: info.state,
|
||||
created_at_millis: info.created_at_millis,
|
||||
completed_at_millis: info.completed_at_millis,
|
||||
duration_millis: info.duration_millis,
|
||||
columns: info.columns,
|
||||
function_name: info.function_name,
|
||||
function_version: info.function_version,
|
||||
failure: info.failure.map(Into::into),
|
||||
progress,
|
||||
paused: info.paused,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user