Skip to content

Commit

Permalink
HGI-6700: Avoid dropping relations from fallback sinks
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyyid committed Oct 29, 2024
1 parent 7bd5442 commit 76df113
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target_salesforce_v3/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@ 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"] or k.lower() in ["id", "externalid"])}
# NOTE: we need to keep relations (__r)
record = {k:v for k,v in record.items() if k.endswith("__r") or (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.get(k, {}).get("type") not in ["date", "datetime"] or (fields.get(k, {}).get("type") in ["date", "datetime"] and v)}

Expand Down

0 comments on commit 76df113

Please sign in to comment.