def _process_bulk_chunk(
    client: Elasticsearch,
    bulk_actions: List[bytes],
    bulk_data: List[
        Union[
            Tuple[_TYPE_BULK_ACTION_HEADER],
            Tuple[_TYPE_BULK_ACTION_HEADER, _TYPE_BULK_ACTION_BODY],
        ]
    ],
    otel_span: OpenTelemetrySpan,
    raise_on_exception: bool = True,
    raise_on_error: bool = True,
    ignore_status: Union[int, Collection[int]] = (),
    *args: Any,
    **kwargs: Any,
) -> Iterable[Tuple[bool, Dict[str, Any]]]:
    """
    Send a bulk request to elasticsearch and process the output.
    """
    with client._otel.use_span(otel_span):
        if isinstance(ignore_status, int):
            ignore_status = (ignore_status,)

        try:
            # send the actual request
            resp = client.bulk(*args, operations=bulk_actions, **kwargs)  # type: ignore[arg-type]
        except ApiError as e:
            gen = _process_bulk_chunk_error(
                error=e,
                bulk_data=bulk_data,
                ignore_status=ignore_status,
                raise_on_exception=raise_on_exception,
                raise_on_error=raise_on_error,
            )
        else:
            gen = _process_bulk_chunk_success(
                resp=resp.body,
                bulk_data=bulk_data,
                ignore_status=ignore_status,
                raise_on_error=raise_on_error,
            )
        yield from gen

    Send a bulk request to elasticsearch and process the output.
    
elasticsearch/helpers/actions.py