fix(python): preserve typed results for reopened refresh jobs (#4981)

Restore typed results for reopened Function and SQL-expression refresh jobs while preserving their handles and cached descriptions.

Fixes https://linear.app/lancedb/issue/ENT-3441.
This commit is contained in:
Jack Ye
2026-11-12 09:21:58 +00:00
committed by GitHub
parent 7b2dfb9e36
commit ced4799ad5
6 changed files with 236 additions and 4 deletions
+9 -2
View File
@@ -24,7 +24,7 @@ use lancedb::{
connection::NamespaceClientPushdownOperation,
database::namespace::LanceNamespaceDatabase,
database::{CreateTableMode, Database, ReadConsistency},
function::GpuClass as LanceGpuClass,
function::{GpuClass as LanceGpuClass, RefreshColumnResult},
graph::PropertyGraphDefinition,
};
use pyo3::{
@@ -854,7 +854,14 @@ impl Connection {
let inner = self_.get_inner()?.clone();
future_into_py(self_.py(), async move {
let job = inner.open_job(&job_id).await.infer_error()?;
Ok(crate::job::Job::new(job))
match job.job_type().as_deref() {
Some("function_refresh" | "computed_refresh" | "refresh_column") => {
Ok(crate::job::Job::new_typed(
job.into_typed::<RefreshColumnResult>().infer_error()?,
))
}
_ => Ok(crate::job::Job::new(job)),
}
})
}