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

Added support for args and kwargs when using the public bigquery proxy · feibyte/docker-python@ae4a0ec · GitHub

Commit ae4a0ec

Browse files
Sam Harris
committed
Added support for args and kwargs when using the public bigquery proxy
1 parent e8abf11 commit ae4a0ec

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎patches/kaggle_gcp.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ class PublicBigqueryClient(bigquery.client.Client):
5757
client = PublicBigqueryClient()
5858
"""
5959

60-
def __init__(self):
60+
def __init__(self, *args, **kwargs):
6161
data_proxy_project = os.getenv("KAGGLE_DATA_PROXY_PROJECT")
6262
anon_credentials = credentials.AnonymousCredentials()
6363
anon_credentials.refresh = lambda *args: None
6464
super().__init__(
65-
project=data_proxy_project, credentials=anon_credentials
65+
project=data_proxy_project, credentials=anon_credentials, *args, **kwargs
6666
)
6767
# TODO: Remove this once https://github.com/googleapis/google-cloud-python/issues/7122 is implemented.
6868
self._connection = _DataProxyConnection(self)

‎tests/test_bigquery.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ def test_proxy_no_project(self):
5656
client = bigquery.Client()
5757
self._test_proxy(client, should_use_proxy=True)
5858

59+
def test_proxy_with_kwargs(self):
60+
env = EnvironmentVarGuard()
61+
env.unset('KAGGLE_BQ_USER_JWT')
62+
with env:
63+
client = bigquery.Client(default_query_job_config=bigquery.QueryJobConfig(maximum_bytes_billed=1e9))
64+
self._test_proxy(client, should_use_proxy=True)
65+
5966
def test_project_with_connected_account(self):
6067
env = EnvironmentVarGuard()
6168
env.set('KAGGLE_BQ_USER_JWT', 'foobar')

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL