Skip to content

build(python)!: stop requiring pylance at runtime - #154

Merged
prrao87 merged 2 commits into
mainfrom
deps/drop-pylance
Nov 13, 2026
Merged

prrao87 merged 2 commits into
mainfrom
deps/drop-pylance

Conversation

@prrao87

@prrao87 prrao87 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Why

lance-csr pinned pylance>=13.0.0,<14 as a runtime dependency, but the engine doesn't read data through pylance. It reads every Lance dataset with the Lance 13 Rust crate it links, the same way LanceDB does. pylance only shows up in three places:

  • the binding checks whether an input is a LanceDataset, then reopens it in Rust by URI, version and storage options;
  • the use_lance_index vector path on a one-shot CypherQuery calls to_table(nearest=...) on the dataset the caller passed;
  • the type hints, which are already behind TYPE_CHECKING or in .pyi stubs.

All three only apply when the caller already holds a pylance object. Without pylance, the LanceDataset check returns false and every query takes the Arrow path.

The pin's stated reason was that other pylance majors might write files Lance 13 can't read. It doesn't prevent that, because datasets can be written by LanceDB or any other tool that bundles its own Lance. What it does do is make installs fail for anyone who also needs pylance 14, which is the current release.

What changed

  • pylance is no longer a runtime dependency. It moves to the dev group with no upper bound and is now locked at 14.0.2, so the test suite writes data with pylance 14 and reads it with Lance 13.
  • The release workflow's wheel smoke test installs pylance explicitly, since the wheel no longer brings it in.
  • The Lance datasets guide now explains near the top why pylance is separate, and that users add it themselves (uv add lance-csr pylance) to write datasets or open them on disk. It says that pylance 13 and 14 both write file format 2.2 by default, and that a dataset in a newer format than Lance 13 knows fails to open with an error. The "use pylance 13.x" warning is gone, and the getting-started page, both READMEs and the snapshots example are updated to match.

Breaking: uv add lance-csr no longer installs pylance. Code that calls import lance without declaring pylance as its own dependency will hit an ImportError after upgrading. The fix is uv add pylance.

Validation

  • make test passes with pylance 14.0.2: 1722 tests.
  • pytest python/tests passes with pylance 13.0.0 layered in through uv run --with: 1718 tests (the four doctests aren't collected in this run).
  • With import lance made to fail (sys.modules["lance"] = None), a CypherEngine two-hop CSR query, VectorSearch with use_lance_index(True), and SqlEngine all return the expected results.
  • make lint, docs/check_snippets.py, zensical build --strict, typos 1.51.1, zizmor 1.32.0 and cargo fmt --check are clean.
  • Not run locally: the Rust test suite (the only Rust change is a comment) and the release workflow's wheel smoke test, which only runs on a release.

🤖 Generated with Claude Code

The engine reads Lance through its own Lance 13 Rust library and only
touches pylance to recognise a LanceDataset handle, which degrades
gracefully when pylance is absent. The `pylance>=13,<14` pin forced
resolver conflicts on users of pylance 14 without protecting anything,
since datasets can be written by any Lance-bundling tool.

pylance moves to the dev group (now locked at 14.0.2), the wheel smoke
test installs it explicitly, and the docs tell users to add it next to
lance-csr to write datasets or open them on disk.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 71c5a9a
Status: ✅  Deploy successful!
Preview URL: https://143c675a.lance-csr.pages.dev
Branch Preview URL: https://deps-drop-pylance.lance-csr.pages.dev

View logs

@prrao87
prrao87 merged commit 1ba1346 into main Nov 13, 2026
27 checks passed
@prrao87
prrao87 deleted the deps/drop-pylance branch November 13, 2026 22:21
prrao87 added a commit that referenced this pull request Nov 14, 2026
Minor bump: #154 (build(python)!) stops requiring pylance at runtime,
which changes the Python package's dependencies.
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