Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Remove undesired _SDC columns
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-pie committed Jun 7, 2019
1 parent 4c97e0c commit ab29812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target_snowflake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def add_metadata_columns_to_schema(schema_message):
Metadata columns gives information about data injections
"""
extended_schema_message = schema_message
extended_schema_message['schema']['properties']['_sdc_extracted_at'] = { 'type': ['null', 'string'], 'format': 'date-time' }
extended_schema_message['schema']['properties']['_sdc_batched_at'] = { 'type': ['null', 'string'], 'format': 'date-time' }
extended_schema_message['schema']['properties']['_sdc_deleted_at'] = { 'type': ['null', 'string'], 'format': 'date-time' }
extended_schema_message['schema']['properties']['_sdc_extracted_at'] = { 'type': ['null', 'string'], 'format': 'date-time' }

return extended_schema_message

Expand All @@ -52,9 +52,9 @@ def add_metadata_values_to_record(record_message, stream_to_sync):
The location of the required attributes are fixed in the stream
"""
extended_record = record_message['record']
extended_record['_sdc_extracted_at'] = record_message.get('time_extracted')
extended_record['_sdc_batched_at'] = datetime.now().isoformat()
extended_record['_sdc_deleted_at'] = record_message.get('record', {}).get('_sdc_deleted_at')
extended_record['_sdc_extracted_at'] = record_message.get('time_extracted')

return extended_record

Expand Down

0 comments on commit ab29812

Please sign in to comment.