feat: add restore remote api (#2282)

This commit is contained in:
LuQQiu
2025-03-27 16:33:52 -07:00
committed by GitHub
parent 72057b743d
commit cba14a5743
5 changed files with 40 additions and 12 deletions

View File

@@ -303,12 +303,16 @@ impl Table {
})
}
pub fn restore(self_: PyRef<'_, Self>) -> PyResult<Bound<'_, PyAny>> {
#[pyo3(signature = (version=None))]
pub fn restore(self_: PyRef<'_, Self>, version: Option<u64>) -> PyResult<Bound<'_, PyAny>> {
let inner = self_.inner_ref()?.clone();
future_into_py(
self_.py(),
async move { inner.restore().await.infer_error() },
)
future_into_py(self_.py(), async move {
if let Some(version) = version {
inner.checkout(version).await.infer_error()?;
}
inner.restore().await.infer_error()
})
}
pub fn query(&self) -> Query {