Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upsert missing from replace_one #68

Open
gusutabopb opened this issue Jan 20, 2023 · 0 comments
Open

upsert missing from replace_one #68

gusutabopb opened this issue Jan 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gusutabopb
Copy link

As of pymongo 4.3.3 the Collection.replace_one method has the upsert parameter, but it's missing from the stub definitions:

https://github.com/sbdchd/mongo-types/blob/main/pymongo-stubs/collection.pyi#L76

    def replace_one(
        self,
        filter: Mapping[str, Any],
        replacement: Mapping[str, Any],
        bypass_document_validation: bool = ...,
        collation: Optional[Collation] = ...,
        hint: Optional[Any] = ...,
        session: Optional[ClientSession] = ...,
    ) -> UpdateResult: ...

This leads to the following false positive from mypy (v0.991):

error: Unexpected keyword argument "upsert" for "replace_one" of "Collection"  [call-arg]
@sbdchd sbdchd added the bug Something isn't working label Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants