feat: allow the index_cache_size to be configured when opening a table (#1245)

This was already configurable in the rust API but it wasn't actually
being passed down to the underlying dataset. I added this option to both
the async python API and the new nodejs API.

I also added this option to the synchronous python API.

I did not add the option to vectordb.
This commit is contained in:
Weston Pace
2024-04-26 13:42:02 -07:00
committed by GitHub
parent 08d62550bb
commit 3d7c48feca
8 changed files with 96 additions and 10 deletions

View File

@@ -134,17 +134,21 @@ impl Connection {
})
}
#[pyo3(signature = (name, storage_options = None))]
#[pyo3(signature = (name, storage_options = None, index_cache_size = None))]
pub fn open_table(
self_: PyRef<'_, Self>,
name: String,
storage_options: Option<HashMap<String, String>>,
index_cache_size: Option<u32>,
) -> PyResult<&PyAny> {
let inner = self_.get_inner()?.clone();
let mut builder = inner.open_table(name);
if let Some(storage_options) = storage_options {
builder = builder.storage_options(storage_options);
}
if let Some(index_cache_size) = index_cache_size {
builder = builder.index_cache_size(index_cache_size);
}
future_into_py(self_.py(), async move {
let table = builder.execute().await.infer_error()?;
Ok(Table::new(table))