diff --git a/tap_mongodb/streams.py b/tap_mongodb/streams.py index de898e8..6c27d76 100644 --- a/tap_mongodb/streams.py +++ b/tap_mongodb/streams.py @@ -332,7 +332,7 @@ def _get_records_log_based( logger.info( f"Yielding 'dummy' record for collection {collection.name} with resume token {resume_token}" ) - yield { + dummy_record: dict = { "replication_key": change_stream.resume_token["_data"], "object_id": None, "document": None, @@ -342,6 +342,12 @@ def _get_records_log_based( "namespace": None, "to": None, } + if should_add_metadata: + now: datetime = datetime.now(timezone.utc) + dummy_record["_sdc_extracted_at"] = now + dummy_record["_sdc_batched_at"] = now + + yield dummy_record keep_open = False # has_seen_a_real_record = True