Skip to content

fix(python): use non-deprecated params in search benchmark fixtures#7285

Open
sezruby wants to merge 1 commit into
lance-format:mainfrom
sezruby:fix-bench-legacy-format
Open

fix(python): use non-deprecated params in search benchmark fixtures#7285
sezruby wants to merge 1 commit into
lance-format:mainfrom
sezruby:fix-bench-legacy-format

Conversation

@sezruby

@sezruby sezruby commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem

The dataset fixtures in python/benchmarks/test_search.py pass deprecated parameters to the dataset APIs:

  • lance.write_dataset(..., use_legacy_format=False)
  • lance.dataset(..., index_cache_size=64 * 1024)

The test config sets filterwarnings = ['error::DeprecationWarning', ...], so these emit DeprecationWarning as errors during fixture setup. As a result every benchmark in test_search.py errors out before running:

DeprecationWarning: use_legacy_format is deprecated, use data_storage_version instead
DeprecationWarning: The 'index_cache_size' parameter is deprecated. Use 'index_cache_size_bytes' instead.

Fix

Switch to the current parameters:

  • use_legacy_format=Falsedata_storage_version="stable" (the exact mapping the deprecation shim applies).
  • index_cache_size=64 * 1024index_cache_size_bytes=512 * 1024 * 1024 (512 MiB comfortably caches these 100k-row IVF_PQ indices).

Verification

$ uv run --group benchmarks pytest python/benchmarks/test_search.py::test_ann_no_refine --benchmark-only
test_ann_no_refine[clean]               541.48 us   1813 ops
test_ann_no_refine[with_delete_files]   770.46 us   1285 ops
test_ann_no_refine[with_new_rows]      2843.17 us    349 ops
3 passed

ruff check / ruff format --check clean.

The search benchmark dataset fixtures pass `use_legacy_format=False` and
`index_cache_size=...` to `write_dataset` / `lance.dataset`, both of which are
deprecated. Because the test config sets `filterwarnings = error::DeprecationWarning`,
fixture setup raised `DeprecationWarning` and every benchmark in
`test_search.py` errored out before running.

Switch to the current parameters (`data_storage_version="stable"` and
`index_cache_size_bytes`), restoring the benchmark suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added A-python Python bindings bug Something isn't working labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant