Skip to content

fix: pin lance-namespace to <0.7 in pylance#6602

Merged
jackye1995 merged 2 commits intorelease/v4.0from
backport/pr-6597-to-release-v4.0
Apr 23, 2026
Merged

fix: pin lance-namespace to <0.7 in pylance#6602
jackye1995 merged 2 commits intorelease/v4.0from
backport/pr-6597-to-release-v4.0

Conversation

@lance-community
Copy link
Copy Markdown
Contributor

Backport of the following PRs:

This PR backports the changes from the original PRs to the release/v4.0 branch.

## Summary

Unblock the `Compatibility Tests` job, which has failed on every PR
since 2026-04-21 23:43 UTC.

## Root cause

- `python/python/tests/compat/venv_manager.py` installs
`pylance=={version}` into per-version test venvs but does **not** pin
`lance-namespace`, so pip resolves the latest release.
- `lance-namespace 0.7.0` was uploaded to PyPI on **2026-04-21 23:43
UTC** and removed public symbols `CreateEmptyTableRequest` /
`CreateEmptyTableResponse` from `lance_namespace/__init__.py` (the
previous release `0.6.1` still exports them).
- Released Lance wheels `pylance==2.0.1` and `pylance==4.0.0b1` contain
a `lance/namespace.py` that does `from lance_namespace import
CreateEmptyTableRequest, CreateEmptyTableResponse, …`. With
`lance-namespace==0.7.0` installed in the compat venv, `import lance`
now fails:
  ```
ImportError: cannot import name 'CreateEmptyTableRequest' from
'lance_namespace'
(venv_2.0.1/.../lance_namespace/__init__.py). Did you mean:
'CreateTableRequest'?
  ```
- Verified against the published wheels on PyPI: `0.6.1` exports the
removed symbols; `0.7.0` does not. Last green `main` Python CI run
(`24689949602`, 2026-04-20 20:55 UTC) predates the `0.7.0` upload.
- This is **not** a regression introduced by any PR — `main` would hit
the same failure on a rerun today.

## Fix

Add `lance-namespace<0.7` to the `pip install` invocation in the compat
venv setup so old Lance wheels resolve a compatible transitive dep.

```diff
                 f"pylance=={self.version}",
+                # Released Lance wheels (e.g. 2.0.1, 4.0.0b1) import
+                # CreateEmptyTableRequest from lance_namespace, which was
+                # removed in lance-namespace 0.7.0. Pin to <0.7 so old wheels
+                # resolve a compatible transitive dep.
+                "lance-namespace<0.7",
                 "pytest",
```

Current `main` Lance builds are unaffected — they install
`lance-namespace` from the workspace, not from PyPI.

## Out of scope

- Per-Lance-version pinning (e.g. narrower `==0.6.1` for
`2.0.1`/`4.0.0b1`). The simple ceiling is sufficient until new wheels
are published with namespace bindings that target
`lance-namespace>=0.7`.
- Upstream `lance-namespace` should either re-export the removed names
as deprecated shims or bump to `1.0.0` with release notes. Worth a
follow-up in that repo.

## Test plan

- [ ] `Compatibility Tests` job passes in CI after this patch.
- [ ] All other Python jobs remain green.
@github-actions github-actions Bot added python ci Github Action or Test issues labels Apr 23, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Mechanical backport of the already-merged pin from #6597 — CI-only dep pin.

Extended reasoning...

Overview

Single-line addition to python/python/tests/compat/venv_manager.py that appends lance-namespace<0.7 to the pip install list used when creating per-version compat test venvs. The accompanying comment explains the reason: released pylance wheels import CreateEmptyTableRequest from lance_namespace, which was removed in 0.7.0. This is a backport of PR #6597 to the release/v4.0 branch.

Security risks

None. The change is confined to test venv setup and only constrains a transitive dependency version during compat testing. No production/runtime code paths are affected, no auth/crypto/permission surfaces are touched.

Level of scrutiny

Low. This is a CI-only dependency pin in a test harness, mechanically backported from an already-merged PR on main. The change is a few lines inside an existing pip install subprocess invocation and follows the same format as the other pinned requirements.

Other factors

The upstream PR (#6597, commit 9215160) is already merged on main. No bugs were found by the bug hunting pass. No outstanding reviewer comments on this PR.

@jackye1995 jackye1995 changed the title ci: pin lance-namespace<0.7 for compat test venvs fix: pin lance-namespace to <0.7 in pylance Apr 23, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Apr 23, 2026
@jackye1995 jackye1995 merged commit e3a053e into release/v4.0 Apr 23, 2026
13 checks passed
@jackye1995 jackye1995 deleted the backport/pr-6597-to-release-v4.0 branch April 23, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci Github Action or Test issues python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants