Skip to content

Commit

Permalink
bump record cleaning logic to keep id and externalid (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyn4 authored Oct 28, 2024
1 parent 9c210b9 commit 7bd5442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target_salesforce_v3/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,9 +884,9 @@ def preprocess_record(self, record, context):
return {}

# keep only available fields and that are creatable or updatable
record = {k:v for k,v in record.items() if fields.get(k) and (fields[k]["createable"] or fields[k]["updateable"])}
record = {k:v for k,v in record.items() if fields.get(k) and (fields[k]["createable"] or fields[k]["updateable"] or k.lower() in ["id", "externalid"])}
# clean empty date fields to avoid salesforce parsing error
record = {k:v for k,v in record.items() if fields[k].get("type") not in ["date", "datetime"] or (fields[k].get("type") in ["date", "datetime"] and v)}
record = {k:v for k,v in record.items() if fields.get(k, {}).get("type") not in ["date", "datetime"] or (fields.get(k, {}).get("type") in ["date", "datetime"] and v)}

# add object_type
record["object_type"] = object_type
Expand Down

0 comments on commit 7bd5442

Please sign in to comment.