Skip to content

Incorrect type annotation for DeleteQueryParameters #108

@federicobond

Description

@federicobond

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:

truncate: typing.NotRequired[bool]
filter_by: str
batch_size: typing.NotRequired[int]
ignore_not_found: typing.NotRequired[bool]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions