etl_lib.core.ClosedLoopBatchProcessor module

class ClosedLoopBatchProcessor(context, task, predecessor, expected_rows=None)[source]

Bases: BatchProcessor

Reporting implementation of a BatchProcessor.

Meant to be the last entry in the list of etl_lib.core.BatchProcessor driving the processing and reporting updates of the processed batches using the etl_lib.core.ProgressReporter from the context.

Parameters:
__init__(context, task, predecessor, expected_rows=None)[source]

Constructs a new etl_lib.core.BatchProcessor instance.

Parameters:
get_batch(max_batch__size)[source]

Provides a batch of data to the caller.

The batch itself could be called and processed from the provided predecessor or generated from other sources.

Parameters:

max_batch__size (int) – The max size of the batch the caller expects to receive.

Return type:

Generator[BatchResults, None, None]

Returns

A generator that yields batches.