Skip to content

test(python): cover arithmetic with distance projections - #3862

Merged
Xuanwo merged 5 commits into
mainfrom
gatekeeper/fix-2618-1
Aug 27, 2026
Merged

Xuanwo merged 5 commits into
mainfrom
gatekeeper/fix-2618-1

Conversation

@lancedb-gatefixer

@lancedb-gatefixer lancedb-gatefixer Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add Python regression coverage for integer and double arithmetic against the generated _distance column
  • merge the current main base containing Lance v11.0.0-beta.3 from chore: update lance dependency to v11.0.0-beta.3 #3896
  • verify both expressions retain the generated scoring field Float32 type and compute the expected values

Root cause

Lance parsed dynamic projection expressions before vector search added its generated Float32 _distance field. Without a typed provisional field, expression discovery rejected mixed numeric arithmetic. Lance upstream fixed discovery and final-schema replanning in lance-format/lance#8163, and the current base consumes that fix through Lance v11.0.0-beta.3.

Validation

  • uv run --extra tests pytest python/tests/test_query.py::test_select_arithmetic_with_distance -vv --maxfail=2 — 2 passed
  • python/.venv/bin/ruff format --check python/python/tests/test_query.py
  • python/.venv/bin/ruff check .

Fixes #2618

@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 repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added Python Python SDK chore Small non-consequential change. Hidden from changelogs. labels Aug 6, 2026
lancedb-gatekeeper[bot]

This comment was marked as outdated.

@lancedb-gatefixer

Copy link
Copy Markdown
Contributor Author

Addressed in 11160d1. Current main containing Lance v11.0.0-beta.3 was merged into this branch, and the rebuilt extension passes both arithmetic parameter cases with the upstream Float32 scoring-column contract.

lancedb-gatekeeper[bot]

This comment was marked as outdated.

@lancedb-gatefixer

Copy link
Copy Markdown
Contributor Author

Addressed in ee223cf. The regression now requests _distance explicitly with similarity, so its value assertion remains durable after scoring auto-projection is removed. Both mixed-numeric cases pass.

lancedb-gatekeeper[bot]

This comment was marked as outdated.

@Xuanwo Xuanwo added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 10, 2026
@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 27, 2026

@lancedb-gatekeeper lancedb-gatekeeper 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.

✅ Gate recommendation: approve.

The refreshed Lance v12 base still passes both mixed-numeric _distance projections, preserves the generated Float32 schema and expected values, and emits no auto-projection warning because _distance is selected explicitly. This remains focused regression coverage for the upstream planner fix.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 27, 2026
@Xuanwo
Xuanwo merged commit 0dd9dfd into main Aug 27, 2026
18 checks passed
@Xuanwo
Xuanwo deleted the gatekeeper/fix-2618-1 branch August 27, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Small non-consequential change. Hidden from changelogs. K-approved Latest Gatekeeper recommendation permits acceptance. Python Python SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(python): LanceError(IO) when using arithmetic SQL expressions

1 participant