From d8142cddbf0751505d345e2e13d15a2f75e1018d Mon Sep 17 00:00:00 2001 From: slothkong Date: Sat, 30 Mar 2024 10:15:28 +0100 Subject: [PATCH] Explicit UTC timezone declaration for instances of datetime.now() --- core/dbt/parser/manifest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index 1814f32d9f2..a9c7f5922d8 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -588,7 +588,10 @@ def safe_update_project_parser_files_partially(self, project_parser_files: Dict) def check_for_model_deprecations(self): for node in self.manifest.nodes.values(): if isinstance(node, ModelNode): - if node.deprecation_date and node.deprecation_date < datetime.now().astimezone(): + if ( + node.deprecation_date + and node.deprecation_date < datetime.now(timezone.utc).astimezone() + ): warn_or_error( DeprecatedModel( model_name=node.name, @@ -602,7 +605,7 @@ def check_for_model_deprecations(self): node.depends_on for resolved_ref in resolved_model_refs: if resolved_ref.deprecation_date: - if resolved_ref.deprecation_date < datetime.now().astimezone(): + if resolved_ref.deprecation_date < datetime.now(timezone.utc).astimezone(): event_cls = DeprecatedReference else: event_cls = UpcomingReferenceDeprecation