+\h@ dZddlmZddlmZmZmZmZmZddl m Z m Z ddl m Z erddlmZ d dZ d dZy ) zRConstants, types, and classes shared across Client Bulk Write API implementations.) annotations) TYPE_CHECKINGAnyMappingMutableMappingNoReturn)ClientBulkWriteExceptionOperationFailure) _get_wce_doc) _DocumentOutcH|jdr|d|d<|dxx|jddz cc<|dxx|jddz cc<|dxx|jddz cc<|dxx|jddz cc<|dxx|jddz cc<|jd}|rC|D]>}|j}|d |z}||d <||d |d <|dj|@t|}|r|d j|y y )z?Merge result of a single bulk write batch into the full result.error nInsertedrnDeletednMatched nModified nUpserted writeErrorsidxopwriteConcernErrorsN)getcopyappendr ) opsoffset full_resultresult write_errorsdoc replacementoriginal_indexwces ^/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pymongo/_client_bulk_shared.py_merge_commandr&s7zz'%g G  ; :: vzz*a88 vzz*a88  ; ::  ; ::::m,L ;C((*K Z&0N!/K  #N 3A 6K   & - -k : ; v C ()005 c|drM|djd|dd}|d}|d}|dk(r |jdrd }t|||t|d trt |||d t ||) z6Raise a ClientBulkWriteException from the full result.rc |dS)Nr)rs r%z4_throw_client_bulk_write_exception..Bs %,r')keyrcodeerrmsgzTransaction numberszrThis MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.r)sort startswithr isinstance BaseExceptionr )rverbose_resultserrr-msgr.s r%"_throw_client_bulk_write_exceptionr7<s =!M"'',F'G-(+6{(m 2:#..)>?-  #64= =+g& 6&{OD+V]J^^ "; @@r'N) rz#list[tuple[str, Mapping[str, Any]]]rintrzMutableMapping[str, Any]rzMapping[str, Any]returnNone)rr r4boolr9r)__doc__ __future__rtypingrrrrrpymongo.errorsr r pymongo.helpers_sharedr pymongo.typingsr r&r7r*r'r%rBsu Y"HHE/,6 ,6 6*6  6  6@AA04A Ar'