Skip to content

Return complete error for sparse vector validation - #5536

Merged
agourlay merged 3 commits into
devfrom
better-sparse-vector-errors
Nov 28, 2024
Merged

agourlay merged 3 commits into
devfrom
better-sparse-vector-errors

Conversation

@agourlay

@agourlay agourlay commented Nov 28, 2024 •

Copy link
Copy Markdown
Member

Always return the precise validation error for sparse vectors.

// sparse vector
if let Some(indices) = vector.indices {
return Ok(VectorInternal::Sparse(
sparse::common::sparse_vector::SparseVector::new(indices.data, vector.data)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the correct error pattern was already present here, in that diff I just removed the unnecessary path :)

}' $QDRANT_HOST qdrant.Points/Search 2>&1
)
if [[ $response != *"Sparse indices does not match sparse vector conditions"* ]]; then
if [[ $response != *"Sparse indices does not match sparse vector conditions: values: Validation error: must be the same length as indices [{}]"* ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ouch this is an ugly error. But I like that we expose more details now!

@agourlay
agourlay merged commit 36d07a5 into dev Nov 28, 2024
@agourlay
agourlay deleted the better-sparse-vector-errors branch November 28, 2024 11:27
timvisee pushed a commit that referenced this pull request Dec 9, 2024
* Return complete error for sparse vector validation

* remove unecessary path

* update test to show new value
@timvisee timvisee mentioned this pull request Dec 9, 2024
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