diff --git a/bigquery/google/cloud/bigquery/_http.py b/bigquery/google/cloud/bigquery/_http.py index 5dd660ea0b8d..dd0d9d01c9de 100644 --- a/bigquery/google/cloud/bigquery/_http.py +++ b/bigquery/google/cloud/bigquery/_http.py @@ -29,7 +29,7 @@ class Connection(_http.JSONConnection): :param client_info: (Optional) instance used to generate user agent. """ - DEFAULT_API_ENDPOINT = "https://www.googleapis.com" + DEFAULT_API_ENDPOINT = "https://bigquery.googleapis.com" def __init__(self, client, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT): super(Connection, self).__init__(client, client_info) diff --git a/bigquery/google/cloud/bigquery/client.py b/bigquery/google/cloud/bigquery/client.py index bcc93c0b7273..103645597515 100644 --- a/bigquery/google/cloud/bigquery/client.py +++ b/bigquery/google/cloud/bigquery/client.py @@ -75,7 +75,7 @@ _MAX_MULTIPART_SIZE = 5 * 1024 * 1024 _DEFAULT_NUM_RETRIES = 6 _BASE_UPLOAD_TEMPLATE = ( - u"https://www.googleapis.com/upload/bigquery/v2/projects/" + u"https://bigquery.googleapis.com/upload/bigquery/v2/projects/" u"{project}/jobs?uploadType=" ) _MULTIPART_URL_TEMPLATE = _BASE_UPLOAD_TEMPLATE + u"multipart" diff --git a/bigquery/tests/unit/test_client.py b/bigquery/tests/unit/test_client.py index 3ee45f52405c..8f148c5ec7f4 100644 --- a/bigquery/tests/unit/test_client.py +++ b/bigquery/tests/unit/test_client.py @@ -3127,7 +3127,7 @@ def _initiate_resumable_upload_helper(self, num_retries=None): # Check the returned values. self.assertIsInstance(upload, ResumableUpload) upload_url = ( - "https://www.googleapis.com/upload/bigquery/v2/projects/" + "https://bigquery.googleapis.com/upload/bigquery/v2/projects/" + self.PROJECT + "/jobs?uploadType=resumable" ) @@ -3196,7 +3196,7 @@ def _do_multipart_upload_success_helper(self, get_boundary, num_retries=None): get_boundary.assert_called_once_with() upload_url = ( - "https://www.googleapis.com/upload/bigquery/v2/projects/" + "https://bigquery.googleapis.com/upload/bigquery/v2/projects/" + self.PROJECT + "/jobs?uploadType=multipart" ) diff --git a/bigquery/tests/unit/test_job.py b/bigquery/tests/unit/test_job.py index 98090a5257fd..b34184f00cd9 100644 --- a/bigquery/tests/unit/test_job.py +++ b/bigquery/tests/unit/test_job.py @@ -73,7 +73,7 @@ def _make_job_resource( started=False, ended=False, etag="abc-def-hjk", - endpoint="https://www.googleapis.com", + endpoint="https://bigquery.googleapis.com", job_type="load", job_id="a-random-id", project_id="some-project", @@ -1022,7 +1022,7 @@ class _Base(object): from google.cloud.bigquery.dataset import DatasetReference from google.cloud.bigquery.table import TableReference - ENDPOINT = "https://www.googleapis.com" + ENDPOINT = "https://bigquery.googleapis.com" PROJECT = "project" SOURCE1 = "http://example.com/source1.csv" DS_ID = "dataset_id"