Skip to content

Commit

Permalink
remove outdated check (qdrant#1941)
Browse files Browse the repository at this point in the history
* remove outdated check

* disable module fixtures
  • Loading branch information
generall committed May 22, 2023
1 parent f5dfeef commit 49db712
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
12 changes: 4 additions & 8 deletions lib/segment/src/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,10 @@ impl Segment {
WithVector::Selector(vectors) => {
let mut result = NamedVectors::default();
for vector_name in vectors {
let vector_opt = self.vector_by_offset(vector_name, point_offset)?;
match vector_opt {
None => {
return Err(OperationError::service_error(
"Vector {vector_name} not found at offset {point_offset}",
))
}
Some(vector) => result.insert(vector_name.clone(), vector),
if let Some(vector) =
self.vector_by_offset(vector_name, point_offset)?
{
result.insert(vector_name.clone(), vector);
}
}
Some(result.into())
Expand Down
35 changes: 33 additions & 2 deletions openapi/tests/openapi_integration/test_optional_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,43 @@
collection_name = 'test_collection'


@pytest.fixture(autouse=True, scope="module")
@pytest.fixture(autouse=True)
def setup():
multivec_collection_setup(collection_name=collection_name)
yield
drop_collection(collection_name=collection_name)


def test_delete_and_search():
response = request_with_validation(
api='/collections/{collection_name}/points/vectors/delete',
method="POST",
path_params={'collection_name': collection_name},
body={
"points": [2, 3],
"vector": ["text"]
}
)
assert response.ok

response = request_with_validation(
api='/collections/{collection_name}/points/search',
method="POST",
path_params={'collection_name': collection_name},
body={
"vector": {
"name": "image",
"vector": [0.0, 0.0, 1.0, 1.0]
},
"limit": 10,
"with_payload": True,
"with_vector": ["text"],
}
)

assert response.ok


def test_retrieve_deleted_vector():
# Delete vector
response = request_with_validation(
Expand Down Expand Up @@ -364,7 +394,8 @@ def no_vectors():
assert not response.ok
assert response.status_code == 422
error = response.json()["status"]["error"]
assert error.__contains__("Validation error in JSON body: [points[0].vector: must specify vectors to update for point]")
assert error.__contains__(
"Validation error in JSON body: [points[0].vector: must specify vectors to update for point]")


def test_no_vectors():
Expand Down

0 comments on commit 49db712

Please sign in to comment.