fix(python): guard optional Lance tests and clarify Optimize policy

This commit is contained in:
ChilePiquin
2026-11-19 18:05:28 -08:00
parent ab791fb708
commit c89678f21a
2 changed files with 9 additions and 5 deletions
+7 -5
View File
@@ -357,11 +357,13 @@ class OptimizeOptions(TypedDict, total=False):
Cleanup controls apply to Embedded convenience Optimize. Durable jobs
reject cleanup and separate index-maintenance requests before submission.
Unspecified options use Lance's defaults for Embedded tables. Enterprise tables
forward ``target_rows_per_fragment``, ``max_source_rows``, ``io_buffer_size``,
and ``batch_size`` as per-job SQL options; other non-default settings are
unsupported. Omitted Enterprise options inherit table tuning, then
deployment/built-in defaults. The server must support these SQL options.
Omitted Embedded options inherit ``lance.compaction.*`` table settings, then
Lance's built-in defaults. Explicit options override table settings.
Enterprise tables forward ``target_rows_per_fragment``, ``max_source_rows``,
``io_buffer_size``, and ``batch_size`` as per-job SQL options; other
non-default settings are unsupported. Omitted Enterprise options inherit
table tuning, then deployment/built-in defaults. The server must support
these SQL options.
These settings do not change table policy.
Compaction planning is row based. Lowering ``target_rows_per_fragment``
+2
View File
@@ -6490,6 +6490,7 @@ async def test_optimize_async_requires_remote(mem_db, mem_db_async):
def test_legacy_compact_files_preserves_data_and_history(tmp_path):
pytest.importorskip("lance")
table = lancedb.connect(tmp_path).create_table("legacy", [{"id": 1}])
table.add([{"id": 2}])
with pytest.warns(DeprecationWarning):
@@ -6512,6 +6513,7 @@ def test_legacy_optimize_nested_settings_embedded(tmp_path):
@pytest.mark.asyncio
@pytest.mark.parametrize("asynchronous", [False, True])
async def test_optimize_inherits_embedded_table_config(tmp_path, asynchronous):
pytest.importorskip("lance")
seed = lancedb.connect(tmp_path).create_table("policy", [{"id": 1}])
seed.add([{"id": 2}])
seed.to_lance().update_config(