Skip to content

Commit

Permalink
Update to PCDM logic to cater for Null EventTimes (rtdip#764)
Browse files Browse the repository at this point in the history
* Update to PCDM logic

Signed-off-by: GBBBAS <[email protected]>

* Update to condition logic

Signed-off-by: GBBBAS <[email protected]>

---------

Signed-off-by: GBBBAS <[email protected]>
  • Loading branch information
GBBBAS authored Jun 19, 2024
1 parent 38af92d commit 65bfce2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _write_latest_to_delta(self, df: DataFrame, epoch_id=None): # NOSONAR
},
),
DeltaMergeConditionValues(
condition="source.EventTime > target.EventTime AND source.GoodLatest.EventTime IS NOT NULL AND source.GoodLatest.EventTime > target.GoodEventTime",
condition="source.EventTime > target.EventTime AND (source.GoodLatest.EventTime IS NOT NULL AND (source.GoodLatest.EventTime > target.GoodEventTime OR target.GoodEventTime IS NULL))",
values={
"EventTime": "source.EventTime",
"Status": "source.Status",
Expand All @@ -197,7 +197,7 @@ def _write_latest_to_delta(self, df: DataFrame, epoch_id=None): # NOSONAR
},
),
DeltaMergeConditionValues(
condition="source.EventTime <= target.EventTime AND source.GoodLatest.EventTime IS NOT NULL AND source.GoodLatest.EventTime > target.GoodEventTime",
condition="source.EventTime <= target.EventTime AND (source.GoodLatest.EventTime IS NOT NULL AND (source.GoodLatest.EventTime > target.GoodEventTime OR target.GoodEventTime IS NULL))",
values={
"GoodEventTime": "source.GoodLatest.EventTime",
"GoodValue": "source.GoodLatest.Value",
Expand Down

0 comments on commit 65bfce2

Please sign in to comment.