Repository navigation
Expose hybrid_policy on SQLQuery - #779
Draft
slorello89 wants to merge 1 commit into
Draft
slorello89 wants to merge 1 commit into
slorello89 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Motivation
Filtered vector queries on Search on Flex require an explicit execution policy. Expose this through
SQLQuery(hybrid_policy="ADHOC_BF")orSQLQuery(hybrid_policy="BATCHES").Changes
Dependency: Keep this PR in draft until the companion sql-redis policy support is released. sql-redis 0.7.1 does not accept the option. Before merging, update both SQL dependency minimums and the lockfile to the supporting release and validate against it. Current end-to-end validation uses the local companion patch.
Release Notes
Add
SQLQuery.hybrid_policyfor filtered vector queries. With a supporting sql-redis version, it selectsFT.SEARCH HYBRID_POLICYorFT.HYBRID FILTER ... POLICY;ADHOC_BFmaps toADHOCforFT.HYBRID.Review record
Reviewed at
9edb472by Codex (GPT-6) withpre-pr-review.Lenses: correctness (option forwarding), security (query options), design (public API), tests (new coverage), docs (API behavior), Redis behavior (policy syntax). None skipped.
Verified: 44 focused unit tests; 153 SQL integration tests passed with 2 expected failures; 8 real Redis policy checks covering both commands, both policies, and sync/async execution with the companion patch; type checks passed for 120 source files; formatting and changed-file pre-commit hooks passed.
Full-tree pre-commit found an existing spelling issue in
redisvl/redis/connection.py; its unrelated automatic correction was reverted. The SQL integration run also logged async cleanupEvent loop is closederrors despite passing tests.Docs consulted: https://redis.io/docs/latest/develop/ai/search-and-query/vectors/ and https://redis.io/docs/latest/commands/ft.hybrid/.
Not checked: full repository test suite, docs build, cluster mode, external providers, or an eventual released sql-redis version containing policy support.