m1racoli commented on code in PR #37539:
URL: https://github.com/apache/airflow/pull/37539#discussion_r1494401168


##########
airflow/providers/google/common/hooks/base_google.py:
##########
@@ -674,7 +674,10 @@ async def acquire_access_token(self, timeout: int = 10) -> 
None:
 
         self.access_token = cast(str, self.credentials.token)
         self.access_token_duration = 3600
-        self.access_token_acquired_at = 
datetime.datetime.now(tz=datetime.timezone.utc)
+        # access_token_acquired_at is specific to gcloud-aio's Token. On 
subsequent calls of `get` it will be used
+        # with `datetime.datetime.utcnow()`. Therefore we have to use an 
offset-naive datetime.
+        # 
https://github.com/talkiq/gcloud-aio/blob/f1132b005ba35d8059229a9ca88b90f31f77456d/auth/gcloud/aio/auth/token.py#L204

Review Comment:
   Nice! In terms of avoiding surprises, I've adjusted the test of `get` such 
that it certainly will make sure that `access_token_acquired_at` is compatible.



-- 
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