fix(query)!: Remove epsilon parameter from VectorQuery#612
Conversation
EPSILON is a VECTOR_RANGE-only attribute. So when emitted inside the KNN bracket, Redis responds with: ``` ResponseError: Error parsing vector similarity parameters: range query attributes were sent for a non-range query ``` - Remove epsilon kwarg, set_epsilon() method, and epsilon property - Remove EPSILON emission from _build_query_string and params - Add unit test to assert contruction-time rejection - Add an integration-suite regression test for the rejection Does not impact VectorRangeQuery
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
|
Fixes Issue #611 |
vishal-bala
left a comment
There was a problem hiding this comment.
LGTM! Just a couple comments about how I think adding a regression test for this is a little bit overkill, since it's incredibly unlikely that someone would attempt to re-add that parameter.
Fine to have the integration test too, but also want to avoid a bloated test suite.
|
Thank
That makes sense! I shall remove the regression test |
- Drop test_vector_query_rejects_epsilon (integration) - Drop test_vector_query_does_not_accept_epsilon (unit) Re-adding the epsilon kwarg to VectorQuery is unlikely enough that an explicit regression test is overkill.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 947a2bd. Configure here.
…Query The constant was only consumed by VectorQuery, which no longer accepts epsilon. No reads of self.EPSILON_PARAM remain in the codebase

EPSILON is a VECTOR_RANGE-only attribute. So when emitted inside the KNN bracket, Redis responds with:
Does not impact VectorRangeQuery
Any potential risk?
epsilontoVectorQuery" is the set of callers whose code was already crashing at execute time.So, this fix does not introduce a new failure mode for any code that was previously succeeding.
Note
Medium Risk
Medium risk because it’s a breaking API change for callers passing
epsilon/usingset_epsilon/epsilon, though it prevents Redis execution-time errors by no longer generating invalid KNN query syntax.Overview
Removes
epsilonsupport fromVectorQuery. The constructor kwarg,set_epsilon()method, andepsilonproperty are deleted, andEPSILONis no longer appended to the KNN query string or included inparams.Updates tests accordingly. Unit coverage that validated
VectorQueryepsilon behavior is removed, and the combined-runtime-params test is adjusted to excludeEPSILONwhile keeping other runtime params (EF_RUNTIME,SEARCH_WINDOW_SIZE,USE_SEARCH_HISTORY,SEARCH_BUFFER_CAPACITY).Reviewed by Cursor Bugbot for commit df0a5a2. Bugbot is set up for automated code reviews on this repo. Configure here.