diff --git a/python/python/lancedb/db.py b/python/python/lancedb/db.py index fe967b303..bf6590f61 100644 --- a/python/python/lancedb/db.py +++ b/python/python/lancedb/db.py @@ -677,7 +677,7 @@ class DBConnection(EnforceOverrides): job_id = LOOP.run( self._conn.create_materialized_view( name, - query, + query=query, auto_refresh=auto_refresh, with_no_data=with_no_data, partition_by=partition_by, @@ -741,7 +741,7 @@ class DBConnection(EnforceOverrides): instead of the default incremental refresh. """ return LOOP.run( - self._conn.refresh_materialized_view( + self._conn._refresh_materialized_view( name, full=full, src_version=src_version, diff --git a/python/python/lancedb/table.py b/python/python/lancedb/table.py index 62b84deff..b6bd6f370 100644 --- a/python/python/lancedb/table.py +++ b/python/python/lancedb/table.py @@ -3813,22 +3813,26 @@ class LanceTable(Table): max_workers: Optional[int] = None, batch_size: Optional[int] = None, priority: Optional[str] = None, - ) -> str: + ) -> "JobHandle": """Trigger recompute of computed columns (REFRESH COLUMN). The expression is resolved server-side from each column's stored binding; columns bound to the same struct-returning function - refresh together. Returns the refresh job id. Server-backed - feature (LanceDB Enterprise / Cloud). + refresh together. Returns a `JobHandle` to wait on, poll, or cancel + (``tbl.refresh_column("col").wait()``) -- mirrors + `MaterializedView.refresh()`. Server-backed feature (LanceDB + Enterprise / Cloud). num_workers / max_workers / batch_size / priority are per-refresh scheduling knobs (how to run THIS refresh) and override any default the function carries. `priority` is a Kueue tier (training | interactive | backfill). """ + from .udf import JobHandle + if isinstance(columns, str): columns = [columns] - return LOOP.run( + job_id = LOOP.run( self._table.refresh_column( list(columns), where=where, @@ -3838,6 +3842,7 @@ class LanceTable(Table): priority=priority, ) ) + return JobHandle(self._conn, job_id) def alter_columns( self, *alterations: Iterable[Dict[str, str]]