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


##########
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:
   When upgrading to gcloud-aio-auth 5 we will override the 
[refresh](https://github.com/talkiq/gcloud-aio/blob/4979115547cf07bc93878158e86263833e3839fc/auth/gcloud/aio/auth/token.py#L230)
 method and thus don't have to deal with `access_token_acquired_at` and other 
boilerplate code anymore.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to