New best practice for checking validity of credentials is no longer credentials.valid which is now deprecated (as of google-auth v2.24.0). Instead the google-auth folks recommend using credentials.token_state
from google.auth.credentials import TokenState
# ...
if not self._credentials.token_state == TokenState.FRESH:
self._credentials.refresh(google.auth.transport.requests.Request())
New best practice for checking validity of credentials is no longer
credentials.valid
which is now deprecated (as of google-auth v2.24.0). Instead the google-auth folks recommend usingcredentials.token_state
All instances of the following: https://github.com/GoogleCloudPlatform/alloydb-python-connector/blob/473f4abbe8e7524c56bd530f13294283a6b4cbcf/google/cloud/alloydb/connector/client.py#L164-L166
Should be replaced to: