Skip to content

fix(query)!: Remove epsilon parameter from VectorQuery#612

Merged
booleanhunter merged 3 commits into
redis:mainfrom
booleanhunter:fix/vector-query-epsilon-removal
May 14, 2026
Merged

fix(query)!: Remove epsilon parameter from VectorQuery#612
booleanhunter merged 3 commits into
redis:mainfrom
booleanhunter:fix/vector-query-epsilon-removal

Conversation

@booleanhunter
Copy link
Copy Markdown
Collaborator

@booleanhunter booleanhunter commented May 13, 2026

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

Any potential risk?

  • The population of working callers being broken by this fix is empty. It will be a breaking-change only if there are callers whose code worked before this change. There aren't
  • The set of "callers who previously passed epsilon to VectorQuery" 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/using set_epsilon/epsilon, though it prevents Redis execution-time errors by no longer generating invalid KNN query syntax.

Overview
Removes epsilon support from VectorQuery. The constructor kwarg, set_epsilon() method, and epsilon property are deleted, and EPSILON is no longer appended to the KNN query string or included in params.

Updates tests accordingly. Unit coverage that validated VectorQuery epsilon behavior is removed, and the combined-runtime-params test is adjusted to exclude EPSILON while 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.

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
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 13, 2026

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.

@booleanhunter
Copy link
Copy Markdown
Collaborator Author

Fixes Issue #611

@vishal-bala vishal-bala added the auto:patch Increment the patch version when merged label May 14, 2026
Copy link
Copy Markdown
Collaborator

@vishal-bala vishal-bala left a comment

Choose a reason for hiding this comment

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

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.

Comment thread tests/integration/test_query.py Outdated
Comment thread tests/unit/test_query_types.py Outdated
@booleanhunter
Copy link
Copy Markdown
Collaborator Author

Thank

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.

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.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 947a2bd. Configure here.

Comment thread redisvl/query/query.py
…Query

The constant was only consumed by VectorQuery, which no longer accepts
epsilon. No reads of self.EPSILON_PARAM remain in the codebase
@booleanhunter booleanhunter merged commit 4041119 into redis:main May 14, 2026
11 checks passed
@booleanhunter booleanhunter deleted the fix/vector-query-epsilon-removal branch May 14, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:patch Increment the patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants