Skip to content

Commit

Permalink
fix(ingest/salesforce): use report timestamp for operations (#7838)
Browse files Browse the repository at this point in the history
Co-authored-by: John Joyce <[email protected]>
  • Loading branch information
hsheth2 and jjoyce0510 authored Apr 20, 2023
1 parent e5d0673 commit 6802142
Show file tree
Hide file tree
Showing 2 changed files with 1,870 additions and 82 deletions.
6 changes: 4 additions & 2 deletions metadata-ingestion/src/datahub/ingestion/source/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,14 @@ def get_platform_instance_workunit(self, datasetUrn: str) -> WorkUnit:
def get_operation_workunit(
self, customObject: dict, datasetUrn: str
) -> Iterable[WorkUnit]:
reported_time: int = int(time.time() * 1000)

if customObject.get("CreatedBy") and customObject.get("CreatedDate"):
timestamp = self.get_time_from_salesforce_timestamp(
customObject["CreatedDate"]
)
operation = OperationClass(
timestampMillis=timestamp,
timestampMillis=reported_time,
operationType=OperationTypeClass.CREATE,
lastUpdatedTimestamp=timestamp,
actor=builder.make_user_urn(customObject["CreatedBy"]["Username"]),
Expand All @@ -393,7 +395,7 @@ def get_operation_workunit(
customObject["LastModifiedDate"]
)
operation = OperationClass(
timestampMillis=timestamp,
timestampMillis=reported_time,
operationType=OperationTypeClass.ALTER,
lastUpdatedTimestamp=timestamp,
actor=builder.make_user_urn(
Expand Down
Loading

0 comments on commit 6802142

Please sign in to comment.