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


##########
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
+        self.access_token_acquired_at = datetime.datetime.utcnow()  # noqa: 
TID251

Review Comment:
   ~~yeah, but without upgrading gcloud-aio-auth's major version (which is a 
big project on its own) we are forced to use the naive version for now, if we 
do not want to break existing functionality.~~



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