):  # ignore last batch
                    return
                batch = _examples_to_batch(examples)
                batch = format_dict(batch) if format_dict else batch
                # then apply the transform
                inputs = batch
                function_args = [inputs] if self.input_columns is None else [inputs[col] for col in self.input_columns]
                if self.with_indices:
                    function_args.append([current_idx + i for i in range(len(key_examples_list))])
                inputs_to_merge = dict(batch)
                processed_inputs = self.function(*function_args, **self.fn_kwargs)
                # this logic mimics the one in Dataset.map
                if self.remove_columns:
                    for c in self.remove_columns:
                        if c in inputs_to_merge:
                            del inputs_to_merge[c]
                        if processed_inputs is inputs and c in processed_inputs: