Retrieves BigQuery access token information from the UserSecrets service. This returns the token for the current kernel as well as its expiry (abs time) if it is present. Example usage: client = UserSecretsClient() token, expiry = client.get_bigquery_
(self)
| 112 | self._write_credentials_file(credential) |
| 113 | |
| 114 | def get_bigquery_access_token(self) -> Tuple[str, Optional[datetime]]: |
| 115 | """Retrieves BigQuery access token information from the UserSecrets service. |
| 116 | |
| 117 | This returns the token for the current kernel as well as its expiry (abs time) if it |
| 118 | is present. |
| 119 | Example usage: |
| 120 | client = UserSecretsClient() |
| 121 | token, expiry = client.get_bigquery_access_token() |
| 122 | """ |
| 123 | return self._get_access_token(GcpTarget.BIGQUERY) |
| 124 | |
| 125 | def _write_credentials_file(self, credentials) -> str: |
| 126 | adc_path = os.path.join(os.environ.get('HOME', '/'), 'gcloud_credential.json') |