Skip to content

Update from code changes: chained where filters combine with AND#293

Merged
prrao87 merged 3 commits into
mainfrom
mintlify/5d0d6797
Jul 2, 2026
Merged

Update from code changes: chained where filters combine with AND#293
prrao87 merged 3 commits into
mainfrom
mintlify/5d0d6797

Conversation

@mintlify

@mintlify mintlify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Document the new behavior where repeated where(...) / only_if(...) calls on a query builder combine with logical AND instead of replacing the previous filter.

Changes

  • Added a "Chaining where clauses" section to the filtering page with Python and TypeScript examples.
  • Added an upgrade warning for users who previously relied on the old replace-on-repeat behavior.

Context

Follows an upstream breaking change in the query builder: calling where more than once on the same query now stacks filters as (previous) AND (new) across Rust, Python, and TypeScript, instead of the last call silently winning.

@wjones127 wjones127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd almost say wait on advertising this for a little bit, until most users have migrated to newer SDKs. We mostly made this change so the behavior would stop surprising users expected chaining to work.

@prrao87

prrao87 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

until most users have migrated to newer SDKs

There's a note at the end there (we can make it clearer as to which SDK versions users need to be aware of) and chained .where() behaviour can still be causing surprises to users of older SDKs. So worth adding in the next release with the follow-up note IMO.

@prrao87 prrao87 added the needs_new_release Only merge once we release a new version of LanceDB label Jul 2, 2026
@prrao87

prrao87 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Updated the chained where(...) section in d37d070 to address the review concern:

  • Reframed chaining as useful for programmatic filter composition, not the default/norm for ordinary predicates.\n- Explicitly says a single where(...) with AND is equally valid and often clearer for fixed predicates.
  • Added exact version boundaries: Python before 0.34.0 and Rust/TypeScript before 0.31.0 used replace-on-repeat behavior, so older-client-compatible examples should use one predicate with AND.

Comment thread docs/search/filtering.mdx Outdated
Comment thread docs/search/filtering.mdx Outdated
Co-authored-by: Prashanth Rao <35005448+prrao87@users.noreply.github.com>
@prrao87 prrao87 merged commit 91f7e37 into main Jul 2, 2026
2 checks passed
@prrao87 prrao87 deleted the mintlify/5d0d6797 branch July 2, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_new_release Only merge once we release a new version of LanceDB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants