Skip to content

Commit 81b8688

Browse files
committed
Address review
1 parent b837d2d commit 81b8688

File tree

5 files changed

+8
-22
lines changed

5 files changed

+8
-22
lines changed

pymongo/asynchronous/bulk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
self,
8888
collection: AsyncCollection[_DocumentType],
8989
ordered: bool,
90-
bypass_document_validation: Optional[bool] = None,
90+
bypass_document_validation: Optional[bool],
9191
comment: Optional[str] = None,
9292
let: Optional[Any] = None,
9393
) -> None:

pymongo/asynchronous/collection.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,8 @@ async def _insert_one(
800800
ordered: bool,
801801
write_concern: WriteConcern,
802802
op_id: Optional[int],
803+
bypass_doc_val: Optional[bool],
803804
session: Optional[AsyncClientSession],
804-
bypass_doc_val: Optional[bool] = None,
805805
comment: Optional[Any] = None,
806806
) -> Any:
807807
"""Internal helper for inserting a single document."""
@@ -3357,13 +3357,7 @@ async def find_one_and_delete(
33573357
if comment is not None:
33583358
kwargs["comment"] = comment
33593359
return await self._find_and_modify(
3360-
filter,
3361-
projection,
3362-
sort,
3363-
let=let,
3364-
hint=hint,
3365-
session=session,
3366-
**kwargs,
3360+
filter, projection, sort, let=let, hint=hint, session=session, **kwargs
33673361
)
33683362

33693363
async def find_one_and_replace(

pymongo/synchronous/bulk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
self,
8888
collection: Collection[_DocumentType],
8989
ordered: bool,
90-
bypass_document_validation: Optional[bool] = None,
90+
bypass_document_validation: Optional[bool],
9191
comment: Optional[str] = None,
9292
let: Optional[Any] = None,
9393
) -> None:

pymongo/synchronous/collection.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ def _insert_one(
799799
ordered: bool,
800800
write_concern: WriteConcern,
801801
op_id: Optional[int],
802+
bypass_doc_val: Optional[bool],
802803
session: Optional[ClientSession],
803-
bypass_doc_val: Optional[bool] = None,
804804
comment: Optional[Any] = None,
805805
) -> Any:
806806
"""Internal helper for inserting a single document."""
@@ -3350,13 +3350,7 @@ def find_one_and_delete(
33503350
if comment is not None:
33513351
kwargs["comment"] = comment
33523352
return self._find_and_modify(
3353-
filter,
3354-
projection,
3355-
sort,
3356-
let=let,
3357-
hint=hint,
3358-
session=session,
3359-
**kwargs,
3353+
filter, projection, sort, let=let, hint=hint, session=session, **kwargs
33603354
)
33613355

33623356
def find_one_and_replace(

test/utils_shared.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,8 @@ def prepare_spec_arguments(spec, arguments, opname, entity_map, with_txn_callbac
615615
# Aggregate uses "batchSize", while find uses batch_size.
616616
elif (arg_name == "batchSize" or arg_name == "allowDiskUse") and opname == "aggregate":
617617
continue
618-
elif (
619-
arg_name == "bypassDocumentValidation"
620-
and opname == "aggregate"
621-
or "find_one_and" in opname
618+
elif arg_name == "bypassDocumentValidation" and (
619+
opname == "aggregate" or "find_one_and" in opname
622620
):
623621
continue
624622
elif arg_name == "timeoutMode":

0 commit comments

Comments
 (0)