mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-02 16:10:58 -05:00
* add minimal working is_null filter * add is_null condition to grpc api (backward compatible) * add unit tests is_null and is_empty conditions * add is_null to points.proto file * add some failing OpenAPI tests * fix a failing test due to change in collection data * refactor MultiValue's check for is_null * fix is_empty condition not picking up "key":[] * remove duplicate OpenAPI integration test * reuse same variable in condition checker tests * update grpc docs * fix is_null cardinality estimation to match is_empty * update openapi specs * remove unused debug statements * add new test points to original test_collection * fix failing tests according to newly added points * add the `"key":[null]` test_case
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
import pytest
|
|
|
|
from .helpers.helpers import request_with_validation
|
|
from .helpers.collection_setup import basic_collection_setup, drop_collection
|
|
|
|
collection_name = 'test_collection_delete'
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup():
|
|
basic_collection_setup(collection_name=collection_name)
|
|
yield
|
|
drop_collection(collection_name=collection_name)
|
|
|
|
|
|
def test_delete_points():
|
|
# delete point by filter (has_id)
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}/points/delete',
|
|
method="POST",
|
|
path_params={'collection_name': collection_name},
|
|
query_params={'wait': 'true'},
|
|
body={
|
|
"filter": {
|
|
"must": [
|
|
{"has_id": [5]}
|
|
]
|
|
}
|
|
}
|
|
)
|
|
assert response.ok
|
|
|
|
# quantity check if the above point id was deleted
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}',
|
|
method="GET",
|
|
path_params={'collection_name': collection_name},
|
|
)
|
|
assert response.ok
|
|
assert response.json()['result']['vectors_count'] == 7
|
|
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}/points/delete',
|
|
method="POST",
|
|
path_params={'collection_name': collection_name},
|
|
query_params={'wait': 'true'},
|
|
body={
|
|
"points": [1, 2, 3, 4]
|
|
}
|
|
)
|
|
assert response.ok
|
|
|
|
# quantity check if the above point id was deleted
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}',
|
|
method="GET",
|
|
path_params={'collection_name': collection_name},
|
|
)
|
|
assert response.ok
|
|
assert response.json()['result']['vectors_count'] == 3
|