Skip to content

Commit

Permalink
add conversao de tz
Browse files Browse the repository at this point in the history
  • Loading branch information
pixuimpou committed Nov 8, 2024
1 parent 0f482e6 commit 3202631
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pipelines/treatment/templates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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:
"""
Expand Down

0 comments on commit 3202631

Please sign in to comment.