feat: upgrade to lance 0.24.1 (#2199)

This commit is contained in:
Weston Pace
2025-03-10 15:18:37 -07:00
committed by GitHub
parent f86b20a564
commit 4a47150ae7
7 changed files with 217 additions and 224 deletions

View File

@@ -13,7 +13,7 @@ use pyo3::{
exceptions::{PyKeyError, PyRuntimeError, PyValueError},
pyclass, pymethods,
types::{IntoPyDict, PyAnyMethods, PyDict, PyDictMethods},
Bound, FromPyObject, PyAny, PyRef, PyResult, Python, ToPyObject,
Bound, FromPyObject, PyAny, PyRef, PyResult, Python,
};
use pyo3_async_runtimes::tokio::future_into_py;
use std::collections::HashMap;
@@ -222,7 +222,7 @@ impl Table {
let stats = inner.index_stats(&index_name).await.infer_error()?;
if let Some(stats) = stats {
Python::with_gil(|py| {
let dict = PyDict::new_bound(py);
let dict = PyDict::new(py);
dict.set_item("num_indexed_rows", stats.num_indexed_rows)?;
dict.set_item("num_unindexed_rows", stats.num_unindexed_rows)?;
dict.set_item("index_type", stats.index_type.to_string())?;
@@ -235,7 +235,7 @@ impl Table {
dict.set_item("num_indices", num_indices)?;
}
Ok(Some(dict.to_object(py)))
Ok(Some(dict.unbind()))
})
} else {
Ok(None)
@@ -266,7 +266,7 @@ impl Table {
versions
.iter()
.map(|v| {
let dict = PyDict::new_bound(py);
let dict = PyDict::new(py);
dict.set_item("version", v.version).unwrap();
dict.set_item(
"timestamp",
@@ -275,14 +275,13 @@ impl Table {
.unwrap();
let tup: Vec<(&String, &String)> = v.metadata.iter().collect();
dict.set_item("metadata", tup.into_py_dict_bound(py))
.unwrap();
dict.to_object(py)
dict.set_item("metadata", tup.into_py_dict(py)?).unwrap();
Ok(dict.unbind())
})
.collect::<Vec<_>>()
.collect::<PyResult<Vec<_>>>()
});
Ok(versions_as_dict)
versions_as_dict
})
}