Files
qdrant/openapi/tests/openapi_integration/test_delete_points.py
Ibrahim M. Akrab f85ae02ab6 add isNull condition for payload filtering (#1617)
* 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
2023-04-01 20:46:50 +02:00

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