mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 12:33:59 +00:00
fix(python): show Function registration progress and image details (#5040)
Report registration lifecycle and client elapsed time through existing job handles, and provide concise image inspection. Preserve quiet wait behavior, environment-lock forwarding, failure diagnostics and timeout recovery.
This commit is contained in:
@@ -424,6 +424,25 @@ code that used the former LanceDB Enterprise-only argument order.
|
||||
|
||||
## Functions and Jobs
|
||||
|
||||
Use `progress=True` when waiting for Function registration in a notebook or
|
||||
terminal. A callback receives structured snapshots instead:
|
||||
|
||||
```python
|
||||
fn = db.create_function(my_function, progress=True)
|
||||
registration = db.create_function_async(other_function)
|
||||
fn = registration.wait(progress=lambda snapshot: print(snapshot))
|
||||
print(fn.image.describe())
|
||||
```
|
||||
|
||||
Registration uses the existing SQL query handle. The current handle reports
|
||||
lifecycle state and `client_elapsed_time_millis` since the handle was created;
|
||||
detailed build phases and build logs are unavailable. Keep the same handle after
|
||||
a wait timeout to resume waiting. Failures retain the server error and request
|
||||
identifiers. `fn.image` has a concise representation; `describe()` exposes Python
|
||||
and CUDA requirements without inspecting Pydantic internals. Platforms, base image
|
||||
and size are `None` until the service reports them. The full image descriptor and
|
||||
canonical JSON remain available.
|
||||
|
||||
A `@function` definition is also a local callable. Call a decorated function
|
||||
directly with row inputs, or call a decorated class with its initialization fields
|
||||
and then call the returned instance; call `close()` if the class defines it. This
|
||||
|
||||
Reference in New Issue
Block a user