PYTHON-4933 - Allow drivers to set bypassDocumentValidation: false on…#2227
PYTHON-4933 - Allow drivers to set bypassDocumentValidation: false on…#2227NoahStapp merged 3 commits intomongodb:masterfrom
Conversation
pymongo/asynchronous/bulk.py
Outdated
| collection: AsyncCollection[_DocumentType], | ||
| ordered: bool, | ||
| bypass_document_validation: bool, | ||
| bypass_document_validation: Optional[bool] = None, |
There was a problem hiding this comment.
This should be bypass_document_validation: Optional[bool], the arg should still be required.
pymongo/asynchronous/collection.py
Outdated
| op_id: Optional[int], | ||
| bypass_doc_val: bool, | ||
| session: Optional[AsyncClientSession], | ||
| bypass_doc_val: Optional[bool] = None, |
There was a problem hiding this comment.
This should be bypass_doc_val: Optional[bool],. It should still be required positional arg in all our internal APIs since the default is never used anyway.
There was a problem hiding this comment.
Our current internal APIs expect it to be a keyword argument and not positional. Is changing it to a positional argument intentional here?
There was a problem hiding this comment.
Previously it was positional:
write_concern: WriteConcern,
op_id: Optional[int],
bypass_doc_val: bool,
session: Optional[AsyncClientSession],There's no need to change it to have a default of None because we always pass a value anyway so the default will never be used.
There was a problem hiding this comment.
Looks like_insert_one is positional, _update and _update_retryable are keyword arguments. We should unify those so they are consistent. I'd prefer them to all be keyword arguments for clarity.
There was a problem hiding this comment.
Let's just keep this one as positional and leave the rest.
pymongo/asynchronous/collection.py
Outdated
| let=let, | ||
| hint=hint, | ||
| session=session, | ||
| **kwargs, |
There was a problem hiding this comment.
Was this change intentional? It seems unneeded.
There was a problem hiding this comment.
Not intended, good catch.
… write commands