Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions pymongo/asynchronous/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,6 @@ def with_options(
read_concern or self.read_concern,
)

def _write_concern_for_cmd(
self, cmd: Mapping[str, Any], session: Optional[AsyncClientSession]
) -> WriteConcern:
raw_wc = cmd.get("writeConcern")
if raw_wc is not None:
return WriteConcern(**raw_wc)
else:
return self._write_concern_for(session)

# See PYTHON-3084.
__iter__ = None

Expand Down
9 changes: 9 additions & 0 deletions pymongo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,15 @@ def _write_concern_for(self, session: Optional[_AgnosticClientSession]) -> Write
return DEFAULT_WRITE_CONCERN
return self.write_concern

def _write_concern_for_cmd(
self, cmd: Mapping[str, Any], session: Optional[_AgnosticClientSession]
) -> WriteConcern:
raw_wc = cmd.get("writeConcern")
Comment on lines +981 to +984
if raw_wc is not None:
return WriteConcern(**raw_wc)
else:
return self._write_concern_for(session)

@property
def read_preference(self) -> _ServerMode:
"""Read only access to the read preference of this instance.
Expand Down
9 changes: 0 additions & 9 deletions pymongo/synchronous/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,6 @@ def with_options(
read_concern or self.read_concern,
)

def _write_concern_for_cmd(
self, cmd: Mapping[str, Any], session: Optional[ClientSession]
) -> WriteConcern:
raw_wc = cmd.get("writeConcern")
if raw_wc is not None:
return WriteConcern(**raw_wc)
else:
return self._write_concern_for(session)

# See PYTHON-3084.
__iter__ = None

Expand Down
Loading