etl_lib.data_sink.CSVBatchSink module

class CSVBatchSink(context, task, predecessor, file_path, **kwargs)[source]

Bases: BatchProcessor

BatchProcessor to write batches of data to a CSV file.

Parameters:
__init__(context, task, predecessor, file_path, **kwargs)[source]

Constructs a new CSVBatchSink.

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.