Skip to content

Commit

Permalink
set metadata on a dummy record
Browse files Browse the repository at this point in the history
  • Loading branch information
menzenski committed Apr 23, 2024
1 parent 95a88b3 commit 909078d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tap_mongodb/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down

0 comments on commit 909078d

Please sign in to comment.