MCPcopy Index your code
hub / github.com/Kaggle/docker-python / get_bigquery_access_token

Method get_bigquery_access_token

patches/kaggle_secrets.py:114–123  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

refreshMethod · 0.95
call_get_access_tokenMethod · 0.95

Calls 1

_get_access_tokenMethod · 0.95

Tested by 2

call_get_access_tokenMethod · 0.76