chore: add pyright static type checking and fix some of the table interface (#1996)

* Enable `pyright` in the project
* Fixed some pyright typing errors in `table.py`
This commit is contained in:
Lei Xu
2025-01-04 15:24:58 -08:00
committed by GitHub
parent 164ce397c2
commit f76c4a5ce1
7 changed files with 83 additions and 91 deletions

View File

@@ -97,10 +97,12 @@ impl Table {
self.name.clone()
}
/// Returns True if the table is open, False if it is closed.
pub fn is_open(&self) -> bool {
self.inner.is_some()
}
/// Closes the table, releasing any resources associated with it.
pub fn close(&mut self) {
self.inner.take();
}
@@ -301,6 +303,7 @@ impl Table {
Query::new(self.inner_ref().unwrap().query())
}
/// Optimize the on-disk data by compacting and pruning old data, for better performance.
#[pyo3(signature = (cleanup_since_ms=None, delete_unverified=None))]
pub fn optimize(
self_: PyRef<'_, Self>,