[Bug]: `batch_id` is not set in Sink context when processing batch messages
Singer SDK Version
0.11.1
Python Version
NA
Bug scope
Targets (data type handling, batching, SQL object generation, etc.)
Operating System
Any
Description
Target._process_record_message initializes the target context by calling Sink._get_context, which in the BatchSink implementation sets the batch_id key to a UUID string. Target._process_batch_message should behave in a similar way.
https://github.com/meltano/sdk/blob/5f9f70a99c6314d87ad91b7a2ad3ef7886483d6f/singer_sdk/target_base.py#L281-L318
Code
No response
Also note the follow
def tally_record_written(self, count: int = 1) -> None:
"""Increment the records written tally.
This method is called automatically by the SDK after
:meth:`~singer_sdk.Sink.process_record()`
or :meth:`~singer_sdk.Sink.process_batch()`.
But this method is never called after processing a batch message. So mark_drained should also be called once the batch message has been processed.
This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.
This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.
This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.