diff --git a/pipelines/treatment/templates/utils.py b/pipelines/treatment/templates/utils.py index f4ab5038..fbbda260 100644 --- a/pipelines/treatment/templates/utils.py +++ b/pipelines/treatment/templates/utils.py @@ -72,7 +72,7 @@ def get_last_materialized_datetime(self, env: str) -> datetime: ) ) - return last_datetime + return convert_timezone(timestamp=last_datetime) def get_datetime_end(self, timestamp: datetime) -> datetime: """ @@ -99,7 +99,9 @@ def is_up_to_date(self, env: str, timestamp: datetime) -> bool: """ last_materialization = self.get_last_materialized_datetime(env=env) last_schedule = cron_get_last_date(cron_expr=self.schedule_cron, timestamp=timestamp) - return last_materialization >= last_schedule - timedelta(hours=self.incremental_delay_hours) + return convert_timezone(timestamp=last_materialization) >= last_schedule - timedelta( + hours=self.incremental_delay_hours + ) def get_next_schedule_datetime(self, timestamp: datetime) -> datetime: """