Skip to content

Commit ebfd76a

Browse files
authored
fix(python): add backfill/refresh wrappers to namespace classes (#6684)
## Summary Add Python wrapper methods for `alter_table_backfill_columns` and `refresh_materialized_view` to both `DirectoryNamespace` and `RestNamespace` in `python/python/lance/namespace.py`. PR #6678 added these methods to the Rust PyO3 binding but missed the Python wrapper layer. Without the wrappers, the `LanceNamespace` ABC's default `UnsupportedOperationError` is called instead of the Rust implementation. ## Test plan - [x] Existing tests pass - Verified locally that `RestNamespace.__dict__` now contains both methods
1 parent f0d40e8 commit ebfd76a

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

python/python/lance/namespace.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
AlterTableAddColumnsResponse,
2121
AlterTableAlterColumnsRequest,
2222
AlterTableAlterColumnsResponse,
23+
AlterTableBackfillColumnsRequest,
24+
AlterTableBackfillColumnsResponse,
2325
AlterTableDropColumnsRequest,
2426
AlterTableDropColumnsResponse,
2527
AlterTransactionRequest,
@@ -77,6 +79,8 @@
7779
MergeInsertIntoTableRequest,
7880
MergeInsertIntoTableResponse,
7981
NamespaceExistsRequest,
82+
RefreshMaterializedViewRequest,
83+
RefreshMaterializedViewResponse,
8084
RegisterTableRequest,
8185
RegisterTableResponse,
8286
RenameTableRequest,
@@ -788,6 +792,20 @@ def alter_table_drop_columns(
788792
response_dict = self._inner.alter_table_drop_columns(request.model_dump())
789793
return AlterTableDropColumnsResponse.from_dict(response_dict)
790794

795+
def alter_table_backfill_columns(
796+
self, request: AlterTableBackfillColumnsRequest
797+
) -> AlterTableBackfillColumnsResponse:
798+
"""Trigger an async backfill job for a computed column."""
799+
response_dict = self._inner.alter_table_backfill_columns(request.model_dump())
800+
return AlterTableBackfillColumnsResponse.from_dict(response_dict)
801+
802+
def refresh_materialized_view(
803+
self, request: RefreshMaterializedViewRequest
804+
) -> RefreshMaterializedViewResponse:
805+
"""Trigger an async materialized view refresh."""
806+
response_dict = self._inner.refresh_materialized_view(request.model_dump())
807+
return RefreshMaterializedViewResponse.from_dict(response_dict)
808+
791809
# Table tag operations
792810

793811
def list_table_tags(self, request: ListTableTagsRequest) -> ListTableTagsResponse:
@@ -1337,6 +1355,20 @@ def alter_table_drop_columns(
13371355
response_dict = self._inner.alter_table_drop_columns(request.model_dump())
13381356
return AlterTableDropColumnsResponse.from_dict(response_dict)
13391357

1358+
def alter_table_backfill_columns(
1359+
self, request: AlterTableBackfillColumnsRequest
1360+
) -> AlterTableBackfillColumnsResponse:
1361+
"""Trigger an async backfill job for a computed column."""
1362+
response_dict = self._inner.alter_table_backfill_columns(request.model_dump())
1363+
return AlterTableBackfillColumnsResponse.from_dict(response_dict)
1364+
1365+
def refresh_materialized_view(
1366+
self, request: RefreshMaterializedViewRequest
1367+
) -> RefreshMaterializedViewResponse:
1368+
"""Trigger an async materialized view refresh."""
1369+
response_dict = self._inner.refresh_materialized_view(request.model_dump())
1370+
return RefreshMaterializedViewResponse.from_dict(response_dict)
1371+
13401372
# Table tag operations
13411373

13421374
def list_table_tags(self, request: ListTableTagsRequest) -> ListTableTagsResponse:

0 commit comments

Comments
 (0)