Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 66bc033

Browse files
lint
1 parent 9de2830 commit 66bc033

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

google/cloud/bigquery/client.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
_MAX_MULTIPART_SIZE = 5 * 1024 * 1024
8181
_DEFAULT_NUM_RETRIES = 6
8282
_API_ACCESS_ENDPOINT = "https://bigquery.googleapis.com"
83-
_BASE_UPLOAD_TEMPLATE = "{host}/upload/bigquery/v2/projects/{project}/jobs?uploadType=";
83+
_BASE_UPLOAD_TEMPLATE = "{host}/upload/bigquery/v2/projects/{project}/jobs?uploadType="
8484
_MULTIPART_URL_TEMPLATE = _BASE_UPLOAD_TEMPLATE + "multipart"
8585
_RESUMABLE_URL_TEMPLATE = _BASE_UPLOAD_TEMPLATE + "resumable"
8686
_GENERIC_CONTENT_TYPE = "*/*"
@@ -2546,11 +2546,12 @@ def _initiate_resumable_upload(
25462546

25472547
if project is None:
25482548
project = self.project
2549-
hostname = _API_ACCESS_ENDPOINT if not hasattr(self._connection, 'get_api_base_url_for_mtls') else self._connection.get_api_base_url_for_mtls()
2550-
upload_url = _RESUMABLE_URL_TEMPLATE.format(
2551-
host=hostname,
2552-
project=project
2549+
hostname = (
2550+
_API_ACCESS_ENDPOINT
2551+
if not hasattr(self._connection, "get_api_base_url_for_mtls")
2552+
else self._connection.get_api_base_url_for_mtls()
25532553
)
2554+
upload_url = _RESUMABLE_URL_TEMPLATE.format(host=hostname, project=project)
25542555

25552556
# TODO: modify ResumableUpload to take a retry.Retry object
25562557
# that it can use for the initial RPC.
@@ -2619,11 +2620,12 @@ def _do_multipart_upload(
26192620
if project is None:
26202621
project = self.project
26212622

2622-
hostname = _API_ACCESS_ENDPOINT if not hasattr(self._connection, 'get_api_base_url_for_mtls') else self._connection.get_api_base_url_for_mtls()
2623-
upload_url = _MULTIPART_URL_TEMPLATE.format(
2624-
host=hostname,
2625-
project=project
2623+
hostname = (
2624+
_API_ACCESS_ENDPOINT
2625+
if not hasattr(self._connection, "get_api_base_url_for_mtls")
2626+
else self._connection.get_api_base_url_for_mtls()
26262627
)
2628+
upload_url = _MULTIPART_URL_TEMPLATE.format(host=hostname, project=project)
26272629
upload = MultipartUpload(upload_url, headers=headers)
26282630

26292631
if num_retries is not None:

tests/system/test_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
else:
134134
PYARROW_INSTALLED_VERSION = None
135135

136-
MTLS_TESTING = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") == "true";
136+
MTLS_TESTING = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") == "true"
137137

138138

139139
def _has_rows(result):
@@ -2654,7 +2654,9 @@ def test_insert_rows_nested_nested_dictionary(self):
26542654
expected_rows = [("Some value", record)]
26552655
self.assertEqual(row_tuples, expected_rows)
26562656

2657-
@pytest.mark.skipif(MTLS_TESTING, reason="mTLS testing has no permission to the max-value.js file")
2657+
@pytest.mark.skipif(
2658+
MTLS_TESTING, reason="mTLS testing has no permission to the max-value.js file"
2659+
)
26582660
def test_create_routine(self):
26592661
routine_name = "test_routine"
26602662
dataset = self.temp_dataset(_make_dataset_id("create_routine"))

0 commit comments

Comments
 (0)