typesense-python icon indicating copy to clipboard operation
typesense-python copied to clipboard

Incorrect type annotation for DeleteQueryParameters

Open federicobond opened this issue 2 months ago • 0 comments

The following code causes a type error with mypy:

collection.documents.delete({"truncate": True})
test.py:1: error: Argument 1 to "delete" of "Documents" has incompatible type "dict[str, bool]";
expected "DeleteQueryParameters | None"  [arg-type]
        collection.documents.delete({"truncate": True})

Because the filter_by key is declared as required in the declaration of DeleteQueryParameters:

https://github.com/typesense/typesense-python/blob/bd8a43dfe5aff297af33672da60998785e2e6e00/src/typesense/types/document.py#L929-L932

federicobond avatar Nov 17 '25 11:11 federicobond