phanikumv commented on code in PR #24682:
URL: https://github.com/apache/airflow/pull/24682#discussion_r909689498
##########
airflow/providers/google/common/hooks/base_google.py:
##########
@@ -270,7 +271,12 @@ def _get_credentials(self) ->
google.auth.credentials.Credentials:
def _get_access_token(self) -> str:
"""Returns a valid access token from Google API Credentials"""
- return self._get_credentials().token
+ credentials = self._get_credentials()
+ auth_req = google.auth.transport.requests.Request()
+ # credentials.token is None
+ # Need to refresh credentials to populate the token
Review Comment:
The method `_get_access_token()` wasn't being used anywhere earlier. A
sample dump of the Credentials object is:
``{'token': None, 'expiry': None, '_quota_project_id': None, '_scopes':
('https://www.googleapis.com/auth/cloud-platform',), '_default_scopes': None,
'_signer': <google.auth.crypt._cryptography_rsa.RSASigner object at
0x40359f3af0>, '_service_account_email':
'[email protected]', '_subject': None,
'_project_id': 'xxxxxx-providers', '_token_uri':
'https://oauth2.googleapis.com/token', '_always_use_jwt_access': False,
'_jwt_credentials': None, '_additional_claims': {}}``
--
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]