FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #165 from Kaggle/fix-cred-refresh · Seth-Rothschild/docker-python@58164a2 · GitHub

Commit 58164a2

Browse files
Aurelio Agundez
authored
Merge pull request Kaggle#165 from Kaggle/fix-cred-refresh
Suppress exception in call to `AnonymousCredentials.refresh` with NOP
2 parents b1cf477 + c79fa24 commit 58164a2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎patches/sitecustomize.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Monkey patches BigQuery client creation to use proxy.
22
import os
33

4-
kaggle_proxy_token = os.getenv("KAGGLE_PROXY_TOKEN")
4+
kaggle_proxy_token = os.getenv("KAGGLE_DATA_PROXY_TOKEN")
55
if kaggle_proxy_token:
66
from google.auth import credentials
77
from google.cloud import bigquery
88
from google.cloud.bigquery._http import Connection
99

10-
Connection.API_BASE_URL = os.getenv("KAGGLE_PROXY_URL")
10+
Connection.API_BASE_URL = os.getenv("KAGGLE_DATA_PROXY_URL")
1111
Connection._EXTRA_HEADERS["X-KAGGLE-PROXY-DATA"] = kaggle_proxy_token
1212

1313
bq_client = bigquery.Client
1414
bigquery.Client = lambda *args, **kwargs: bq_client(
1515
*args,
1616
credentials=credentials.AnonymousCredentials(),
17-
project=os.getenv("KAGGLE_PROXY_PROJECT"),
18-
**kwargs)
17+
project=os.getenv("KAGGLE_DATA_PROXY_PROJECT"),
18+
**kwargs)
19+
20+
credentials.AnonymousCredentials.refresh = lambda *args: None

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL