@@ -1018,7 +1018,7 @@ def unack_write(
10181018 cmd = self ._start (cmd , request_id , docs )
10191019 start = datetime .datetime .now ()
10201020 try :
1021- result = self .conn .unack_write (msg , max_doc_size )
1021+ result = self .conn .unack_write (msg , max_doc_size ) # type: ignore[func-returns-value]
10221022 if self .publish :
10231023 duration = (datetime .datetime .now () - start ) + duration
10241024 if result is not None :
@@ -1050,7 +1050,7 @@ def write_command(
10501050 request_id : int ,
10511051 msg : bytes ,
10521052 docs : List [Mapping [str , Any ]],
1053- ) -> Mapping [str , Any ]:
1053+ ) -> Dict [str , Any ]:
10541054 """A proxy for SocketInfo.write_command that handles event publishing."""
10551055 if self .publish :
10561056 assert self .start_time is not None
@@ -1127,7 +1127,7 @@ class _EncryptedBulkWriteContext(_BulkWriteContext):
11271127
11281128 def __batch_command (
11291129 self , cmd : MutableMapping [str , Any ], docs : List [Mapping [str , Any ]]
1130- ) -> Tuple [Mapping [str , Any ], List [Mapping [str , Any ]]]:
1130+ ) -> Tuple [Dict [str , Any ], List [Mapping [str , Any ]]]:
11311131 namespace = self .db_name + ".$cmd"
11321132 msg , to_send = _encode_batched_write_command (
11331133 namespace , self .op_type , cmd , docs , self .codec , self
@@ -1517,7 +1517,7 @@ def unpack_response(
15171517 codec_options : CodecOptions = _UNICODE_REPLACE_CODEC_OPTIONS ,
15181518 user_fields : Optional [Mapping [str , Any ]] = None ,
15191519 legacy_response : bool = False ,
1520- ) -> List [_DocumentOut ]:
1520+ ) -> List [Dict [ str , Any ] ]:
15211521 """Unpack a response from the database and decode the BSON document(s).
15221522
15231523 Check the response for errors and unpack, returning a dictionary
@@ -1541,7 +1541,7 @@ def unpack_response(
15411541 return bson .decode_all (self .documents , codec_options )
15421542 return bson ._decode_all_selective (self .documents , codec_options , user_fields )
15431543
1544- def command_response (self , codec_options : CodecOptions ) -> Mapping [str , Any ]:
1544+ def command_response (self , codec_options : CodecOptions ) -> Dict [str , Any ]:
15451545 """Unpack a command response."""
15461546 docs = self .unpack_response (codec_options = codec_options )
15471547 assert self .number_returned == 1
@@ -1604,7 +1604,7 @@ def unpack_response(
16041604 codec_options : CodecOptions = _UNICODE_REPLACE_CODEC_OPTIONS ,
16051605 user_fields : Optional [Mapping [str , Any ]] = None ,
16061606 legacy_response : bool = False ,
1607- ) -> List [_DocumentOut ]:
1607+ ) -> List [Dict [ str , Any ] ]:
16081608 """Unpack a OP_MSG command response.
16091609
16101610 :Parameters:
@@ -1619,7 +1619,7 @@ def unpack_response(
16191619 assert not legacy_response
16201620 return bson ._decode_all_selective (self .payload_document , codec_options , user_fields )
16211621
1622- def command_response (self , codec_options : CodecOptions ) -> Mapping [str , Any ]:
1622+ def command_response (self , codec_options : CodecOptions ) -> Dict [str , Any ]:
16231623 """Unpack a command response."""
16241624 return self .unpack_response (codec_options = codec_options )[0 ]
16251625
0 commit comments