File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -143,15 +143,17 @@ def _process_bulk_chunk(
143143 bulk_data , map (methodcaller ("popitem" ), resp ["items" ])
144144 ):
145145 ok = 200 <= item .get ("status" , 500 ) < 300
146- if not ok and raise_on_error :
146+ if not ok :
147147 # include original document source
148- if len ( data ) > 1 :
148+ if op_type != "delete" :
149149 item ["data" ] = data [1 ]
150- errors .append ({op_type : item })
151-
152- if ok or not errors :
153- # if we are not just recording all errors to be able to raise
154- # them all at once, yield items individually
150+ if raise_on_error :
151+ errors .append ({op_type : item })
152+ else :
153+ # if we are not just recording all errors to be able to raise
154+ # them all at once, yield items individually
155+ yield ok , {op_type : item }
156+ else :
155157 yield ok , {op_type : item }
156158
157159 if errors :
You can’t perform that action at this time.
0 commit comments