Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept K parameter as float if there is no loss in the precision after rounding to the integer #1761

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

sivukhin
Copy link
Contributor

@sivukhin sivukhin commented Sep 29, 2024

Context

It can be hard in some clients (JS for example, see) to distinguish between INTEGERs and FLOATs - so we always bind FLOATs instead (

This create unnecessary error: vector index(search): third parameter (k) must be a non-negative integer

This PR fixes vector search and make it tolerant to the FLOAT parameter if there is no precision loss (so, the provided FLOAT value is actually INTEGER). In case of precision loss (for example, user provided value 2.5 for the K parameter) the error message will look like this: vector index(search): third parameter (k) must be an integer, but float value were provided

…r rounding to the integer

- it cah be hard in some cliens (JS for example) to distinguish between INTEGERs and FLOATs - so we always bind FLOATs instead
- this create unnecessary error: "vector index(search): third parameter (k) must be a non-negative integer"
@sivukhin sivukhin added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit 54ff421 Sep 30, 2024
19 checks passed
@sivukhin sivukhin deleted the vector-search-accept-k-float branch September 30, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants