agent: Add more Rust code examples, update TODO check (#28737)

Release Notes:

- N/A
This commit is contained in:
Thomas Mickley-Doyle 2025-04-15 11:52:08 -05:00 committed by GitHub
parent d0f806456c
commit b1e4e6048a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 142 additions and 2 deletions

View file

@ -0,0 +1,3 @@
url = "https://github.com/lancedb/lancedb.git"
revision = "698f329598bcfa8a5bf0feedfdd4344a4cdc7e4d"
language_extension = "rs"

View file

@ -0,0 +1,6 @@
1. The `restore` method is updated across Python and Rust components of LanceDB to accept an optional `version` argument, enabling more flexible restoration of historical table versions.
2. Python async bindings in `_lancedb.pyi` and `table.py` are updated to reflect the new method signature `restore(version: Optional[int] = None)`, aligning type hints and implementations.
3. The remote table interface in `remote/table.py` includes a corresponding `restore` method, bridging the sync API to the async backend with version support.
4. The Rust FFI layer (`table.rs`) is modified to accept the optional `version` argument, with logic that performs a `checkout(version)` if specified, before proceeding to `restore()`, improving control over the restore flow.
5. The `RemoteTable` implementation in `remote/table.rs` now constructs and sends a versioned restore request via HTTP, enabling client-side version-specific restoration even in cloud deployments.
6. Docstrings and comments are added or expanded to explain the behavior of the `restore` function, particularly the no-op case when restoring the latest version, enhancing code maintainability and developer understanding.

View file

@ -0,0 +1 @@
I'd like to update the `restore` method in LanceDB to support restoring to a specific historical version of a table. Please modify all relevant files to add an optional `version` parameter to `restore`, defaulting to `None`. When `version` is provided, the implementation should perform a checkout to that version before executing the restore. If `version` is not specified, it should restore the currently checked-out version. Update the Python async bindings (`_lancedb.pyi`, `table.py`, and `remote/table.py`) to reflect the new method signature and behavior. In the Rust FFI layer (`python/src/table.rs`), modify the `restore` function to accept and correctly handle the optional version argument. For the cloud-backed `RemoteTable` in Rust (`rust/lancedb/src/remote/table.rs`), ensure that the version is included in the HTTP request body during a restore operation. Add or update docstrings and comments as needed to clarify how restore behaves with and without the `version` argument.