feat(python): add exact function revocation

This commit is contained in:
Xuanwo
2026-08-12 08:22:49 +08:00
parent d902144605
commit f65bf89c98
7 changed files with 775 additions and 1 deletions
+18
View File
@@ -687,6 +687,24 @@ impl Connection {
Ok(None::<()>)
})
}
/// Revoke an exact immutable Function by administrator set-bit.
///
/// Clones the observed native [`crate::function::Function`] once and
/// delegates to Rust [`lancedb::Connection::revoke_function`].
pub fn _revoke_function<'py>(
self_: PyRef<'py, Self>,
function: Bound<'_, crate::function::Function>,
) -> PyResult<Bound<'py, PyAny>> {
let inner = self_.get_inner()?.clone();
let function = function.get().inner().clone();
future_into_py(self_.py(), async move {
inner.revoke_function(&function).await.infer_error()?;
// `()` maps to an empty Python tuple via IntoPyObject; return Option
// so the async bridge yields exact Python None.
Ok(None::<()>)
})
}
}
#[pyfunction]