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

Add docstring and another nit. · HpcDataLab/docker-python@da1b91e · GitHub

Commit da1b91e

Browse files
committed
Add docstring and another nit.
1 parent ba8e462 commit da1b91e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎patches/sitecustomize.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66

77
class KaggleKernelCredentials(credentials.Credentials):
8+
"""Custom Credentials used to authenticate using the Kernel's connected OAuth account."""
9+
810
def refresh(self, request):
911
print("Calling Kaggle.UserSecrets to refresh token.")
1012
# Set self.token and self.expiry here.
@@ -17,7 +19,7 @@ def refresh(self, request):
1719
def monkeypatch_bq(bq_client, *args, **kwargs):
1820
data_proxy_project = os.getenv("KAGGLE_DATA_PROXY_PROJECT")
1921
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')
2123
# Use Data Proxy if user has specified to use the Kaggle project, or if
2224
# there are no connected GCP accounts (to maintain backwards compatibility).
2325
if bq_user_jwt is None and specified_project and specified_project.lower() != 'kaggle':

‎tests/test_bigquery.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
URL = "http://%s:%s" % (HOSTNAME, PORT)
1414

1515
class TestBigQuery(unittest.TestCase):
16+
1617
def _test_proxy(self, client, should_use_proxy):
1718
class HTTPHandler(BaseHTTPRequestHandler):
1819
called = False

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL