etl_lib.data_source.CypherBatchSource module
- class CypherBatchSource(context, task, query, record_transformer=None, **kwargs)[source]
Bases:
BatchProcessor- Parameters:
- __init__(context, task, query, record_transformer=None, **kwargs)[source]
Constructs a new CypherBatchSource.
- Parameters:
context (
ETLContext) –etl_lib.core.ETLContext.ETLContextinstance.task (
Task) –etl_lib.core.Task.Taskinstance owning this batchProcessor.query (
str) – Cypher query to execute.record_transformer (
Optional[Callable[[Record],dict]]) – Optional function to transform each record. See Neo4j API documentation on result_transformer_kwargs – Arguments passed as parameters with the query.
- 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 – The max size of the batch the caller expects to receive.
max_batch_size (int)
- Return type:
- Returns
A generator that yields batches.