Support legacy SDK tag filter aliases#332
Open
abrookins wants to merge 1 commit into
Open
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
in_->any,not_eq->ne, andnone->not_in.not_infilter support for tag and enum-backed filters.alltag filters to require every value instead of rendering the same OR expression asany.SearchRequestparsing of SDK-emitted payloads.Related to #310, which adds server-shaped tag filter support to the Java client and surfaced the current Python/TypeScript compatibility gap.
Tests
pytest tests/test_filters.pymake pre-commitmake test(863 passed, 108 skipped)Not run:
make test-api(OPENAI_API_KEYis not set in this shell).Note
Medium Risk
Changes how
allfilters query Redis (behavior fix that may narrow results for existing callers) and expands accepted search request shapes for compatibility.Overview
Brings server-side tag/enum filters in line with legacy SDK field names and tightens how multi-value filters compile to Redis.
TagFilter/EnumFilternow accept SDK aliases at parse time:in_→any,not_eq→ne, and (tags only)none→not_in, with validation if an alias and its canonical field are both set. A newnot_inoption excludes any of the listed tag/enum values via a negated union expression.allno longer renders the same OR expression asany; it now ANDs per-value tag constraints so “must have every value” matches intended semantics.Tests cover alias mapping,
not_in, the correctedallstring form, andSearchRequestparsing when clients send SDK-shaped payloads (session_id,namespace,topics).Reviewed by Cursor Bugbot for commit 2886b5f. Bugbot is set up for automated code reviews on this repo. Configure here.