Taragolis commented on code in PR #37138:
URL: https://github.com/apache/airflow/pull/37138#discussion_r1475662271


##########
tests/providers/amazon/aws/hooks/test_sagemaker.py:
##########
@@ -528,7 +528,9 @@ def test_secondary_training_status_changed_false(self):
     def test_secondary_training_status_message_status_changed(self):
         now = datetime.now(tzlocal())
         SECONDARY_STATUS_DESCRIPTION_1["LastModifiedTime"] = now
-        expected_time = 
datetime.utcfromtimestamp(time.mktime(now.timetuple())).strftime("%Y-%m-%d 
%H:%M:%S")
+        expected_time = datetime.fromtimestamp(time.mktime(now.timetuple()), 
tz=timezone.utc).strftime(
+            "%Y-%m-%d %H:%M:%S"
+        )

Review Comment:
   Yeah I've also was confused by this construction when replace deprecated 
methods.
   
   i think it could be replaced by
   ```now.astimezone(tz=timezone.utc).strftime("%Y-%m-%d %H:%M:%S")```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to