Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetic1728 committed Jan 28, 2021
1 parent 9de2830 commit 66bc033
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
20 changes: 11 additions & 9 deletions google/cloud/bigquery/client.py
Expand Up @@ -80,7 +80,7 @@
_MAX_MULTIPART_SIZE = 5 * 1024 * 1024
_DEFAULT_NUM_RETRIES = 6
_API_ACCESS_ENDPOINT = "https://bigquery.googleapis.com"
_BASE_UPLOAD_TEMPLATE = "{host}/upload/bigquery/v2/projects/{project}/jobs?uploadType=";
_BASE_UPLOAD_TEMPLATE = "{host}/upload/bigquery/v2/projects/{project}/jobs?uploadType="
_MULTIPART_URL_TEMPLATE = _BASE_UPLOAD_TEMPLATE + "multipart"
_RESUMABLE_URL_TEMPLATE = _BASE_UPLOAD_TEMPLATE + "resumable"
_GENERIC_CONTENT_TYPE = "*/*"
Expand Down Expand Up @@ -2546,11 +2546,12 @@ def _initiate_resumable_upload(

if project is None:
project = self.project
hostname = _API_ACCESS_ENDPOINT if not hasattr(self._connection, 'get_api_base_url_for_mtls') else self._connection.get_api_base_url_for_mtls()
upload_url = _RESUMABLE_URL_TEMPLATE.format(
host=hostname,
project=project
hostname = (
_API_ACCESS_ENDPOINT
if not hasattr(self._connection, "get_api_base_url_for_mtls")
else self._connection.get_api_base_url_for_mtls()
)
upload_url = _RESUMABLE_URL_TEMPLATE.format(host=hostname, project=project)

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

hostname = _API_ACCESS_ENDPOINT if not hasattr(self._connection, 'get_api_base_url_for_mtls') else self._connection.get_api_base_url_for_mtls()
upload_url = _MULTIPART_URL_TEMPLATE.format(
host=hostname,
project=project
hostname = (
_API_ACCESS_ENDPOINT
if not hasattr(self._connection, "get_api_base_url_for_mtls")
else self._connection.get_api_base_url_for_mtls()
)
upload_url = _MULTIPART_URL_TEMPLATE.format(host=hostname, project=project)
upload = MultipartUpload(upload_url, headers=headers)

if num_retries is not None:
Expand Down
6 changes: 4 additions & 2 deletions tests/system/test_client.py
Expand Up @@ -133,7 +133,7 @@
else:
PYARROW_INSTALLED_VERSION = None

MTLS_TESTING = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") == "true";
MTLS_TESTING = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") == "true"


def _has_rows(result):
Expand Down Expand Up @@ -2654,7 +2654,9 @@ def test_insert_rows_nested_nested_dictionary(self):
expected_rows = [("Some value", record)]
self.assertEqual(row_tuples, expected_rows)

@pytest.mark.skipif(MTLS_TESTING, reason="mTLS testing has no permission to the max-value.js file")
@pytest.mark.skipif(
MTLS_TESTING, reason="mTLS testing has no permission to the max-value.js file"
)
def test_create_routine(self):
routine_name = "test_routine"
dataset = self.temp_dataset(_make_dataset_id("create_routine"))
Expand Down

0 comments on commit 66bc033

Please sign in to comment.