| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | class KaggleKernelCredentials(credentials.Credentials): | |
| 8 | + """Custom Credentials used to authenticate using the Kernel's connected OAuth account.""" | ||
| 9 | + | ||
| 8 | 10 | def refresh(self, request): | |
| 9 | 11 | print("Calling Kaggle.UserSecrets to refresh token.") | |
| 10 | 12 | # Set self.token and self.expiry here. | |
@@ -17,7 +19,7 @@ def refresh(self, request): | |||
| 17 | 19 | def monkeypatch_bq(bq_client, *args, **kwargs): | |
| 18 | 20 | data_proxy_project = os.getenv("KAGGLE_DATA_PROXY_PROJECT") | |
| 19 | 21 | bq_user_jwt = os.getenv("KAGGLE_BQ_USER_JWT") | |
| 20 | - specified_project = kwargs['project'] if 'project' in kwargs else None | ||
| 22 | + specified_project = kwargs.get('project') | ||
| 21 | 23 | # Use Data Proxy if user has specified to use the Kaggle project, or if | |
| 22 | 24 | # there are no connected GCP accounts (to maintain backwards compatibility). | |
| 23 | 25 | if bq_user_jwt is None and specified_project and specified_project.lower() != 'kaggle': | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ | |||
| 13 | 13 | URL = "http://%s:%s" % (HOSTNAME, PORT) | |
| 14 | 14 | ||
| 15 | 15 | class TestBigQuery(unittest.TestCase): | |
| 16 | + | ||
| 16 | 17 | def _test_proxy(self, client, should_use_proxy): | |
| 17 | 18 | class HTTPHandler(BaseHTTPRequestHandler): | |
| 18 | 19 | called = False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments