Skip to content

refactor: drop pylance version checks from indexing and search - #5304

Open
jonasdedden wants to merge 1 commit into
lance-format:mainfrom
jonasdedden:refactor/pylance-12-index-search-checks
Open

jonasdedden wants to merge 1 commit into
lance-format:mainfrom
jonasdedden:refactor/pylance-12-index-search-checks

Conversation

@jonasdedden

Copy link
Copy Markdown
Contributor

Summary

Part 2/3 of splitting up #5301. Now that #5295 made pylance>=12.0.0 the minimum, this removes the pylance version guards from indexing and search.

  • index.py:
    • Removed the pylance >= 0.36.0 checks: _check_pylance_version and the inline copy in create_scalar_index.
    • Removed merge_index_metadata_compat. Its one-argument merge_index_metadata fallback is never used, so we call merge_index_metadata directly.
    • Removed the hasattr guards around dataset.optimize.optimize_indices.
  • search.py: removed the index_segments signature probing and the initial_storage_options / fragment_id fallbacks.
  • Tests:
    • Removed the 0.36/0.37 version gates and the "not yet implemented" skip branches.
    • Removed the missing-optimize test, which is always skipped on supported versions.
    • Removed the redundant asserts on the already-typed return value of optimize_indices.
    • The index-module stub in test_vector_index_options.py now provides lance.bitmap, which index.py imports, instead of a fake lance.__version__.

Compatibility

  • The public API is unchanged: none of the removed helpers are exported from lance_ray.
  • The only behavior removed is the RuntimeErrors raised on pylance versions that pyproject.toml no longer allows.
  • pyproject.toml and uv.lock are untouched.

Testing

  • uv run mypy (strict), ruff check, ruff format --check: clean
  • pytest on this branch (test_distributed_indexing, test_distributed_search, test_vector_index_options): 110 passed, 0 skipped
  • Full suite with all three split PRs combined: 299 passed, 0 skipped (pylance 12.0.0, Python 3.12)

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

pylance 12 is now the minimum, so the guards for older releases are dead:

- index: remove the `pylance >= 0.36.0` checks (`_check_pylance_version`
  and its inline twin in `create_scalar_index`), the
  `merge_index_metadata_compat` wrapper whose one-argument fallback is never
  taken, and the `hasattr` guards around `dataset.optimize.optimize_indices`.
- search: remove the `index_segments` signature probing and the
  `initial_storage_options` / `fragment_id` fallbacks.
- tests: remove the 0.36/0.37 version gates, the "not yet implemented" skip
  branches, the always-skipped missing-`optimize` test, and the redundant
  asserts on `optimize_indices`' typed return value. The index module stub
  now provides `lance.bitmap` instead of a fake `lance.__version__`.
@jonasdedden
jonasdedden force-pushed the refactor/pylance-12-index-search-checks branch from d137d2f to 75b4ef8 Compare October 24, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant