Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d8d58ad

Browse filesBrowse files
committed
Merge pull request #1120 from tseaver/bigquery-rename_run_query_to_indicate_async
Rename 'RunQueryJob'->'RunQueryAsyncJob'.
2 parents dd35f25 + c95a6b8 commit d8d58ad
Copy full SHA for d8d58ad

File tree

Expand file treeCollapse file tree

4 files changed

+16
-16
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+16
-16
lines changed

‎gcloud/bigquery/client.py

Copy file name to clipboardExpand all lines: gcloud/bigquery/client.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from gcloud.bigquery.job import CopyJob
2222
from gcloud.bigquery.job import ExtractTableToStorageJob
2323
from gcloud.bigquery.job import LoadTableFromStorageJob
24-
from gcloud.bigquery.job import RunQueryJob
24+
from gcloud.bigquery.job import RunAsyncQueryJob
2525

2626

2727
class Client(JSONClient):
@@ -155,16 +155,16 @@ def extract_table_to_storage(self, name, source, *destination_uris):
155155
return ExtractTableToStorageJob(name, source, destination_uris,
156156
client=self)
157157

158-
def run_query(self, name, query):
159-
"""Construct a job for running a SQL query.
158+
def run_async_query(self, name, query):
159+
"""Construct a job for running a SQL query asynchronously.
160160
161161
:type name: string
162162
:param name: Name of the job.
163163
164164
:type query: string
165165
:param query: SQL query to be executed
166166
167-
:rtype: :class:`gcloud.bigquery.job.RunQueryJob`
168-
:returns: a new ``RunQueryJob`` instance
167+
:rtype: :class:`gcloud.bigquery.job.RunAsyncQueryJob`
168+
:returns: a new ``RunAsyncQueryJob`` instance
169169
"""
170-
return RunQueryJob(name, query, client=self)
170+
return RunAsyncQueryJob(name, query, client=self)

‎gcloud/bigquery/job.py

Copy file name to clipboardExpand all lines: gcloud/bigquery/job.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Encoding(_EnumProperty):
125125

126126

127127
class QueryPriority(_EnumProperty):
128-
"""Pseudo-enum for ``RunQueryJob.priority`` property."""
128+
"""Pseudo-enum for ``RunAsyncQueryJob.priority`` property."""
129129
INTERACTIVE = 'INTERACTIVE'
130130
BATCH = 'BATCH'
131131
ALLOWED = (INTERACTIVE, BATCH)
@@ -797,7 +797,7 @@ class _QueryConfiguration(object):
797797
_write_disposition = None
798798

799799

800-
class RunQueryJob(_BaseJob):
800+
class RunAsyncQueryJob(_BaseJob):
801801
"""Asynchronous job: query tables.
802802
803803
:type name: string
@@ -811,7 +811,7 @@ class RunQueryJob(_BaseJob):
811811
for the dataset (which requires a project).
812812
"""
813813
def __init__(self, name, query, client):
814-
super(RunQueryJob, self).__init__(name, client)
814+
super(RunAsyncQueryJob, self).__init__(name, client)
815815
self.query = query
816816
self._configuration = _QueryConfiguration()
817817

‎gcloud/bigquery/test_client.py

Copy file name to clipboardExpand all lines: gcloud/bigquery/test_client.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,16 @@ def test_extract_table_to_storage(self):
186186
self.assertEqual(job.source, source)
187187
self.assertEqual(list(job.destination_uris), [DESTINATION])
188188

189-
def test_run_query(self):
190-
from gcloud.bigquery.job import RunQueryJob
189+
def test_run_async_query(self):
190+
from gcloud.bigquery.job import RunAsyncQueryJob
191191
PROJECT = 'PROJECT'
192192
JOB = 'job_name'
193193
QUERY = 'select count(*) from persons'
194194
creds = _Credentials()
195195
http = object()
196196
client = self._makeOne(project=PROJECT, credentials=creds, http=http)
197-
job = client.run_query(JOB, QUERY)
198-
self.assertTrue(isinstance(job, RunQueryJob))
197+
job = client.run_async_query(JOB, QUERY)
198+
self.assertTrue(isinstance(job, RunAsyncQueryJob))
199199
self.assertTrue(job._client is client)
200200
self.assertEqual(job.name, JOB)
201201
self.assertEqual(job.query, QUERY)

‎gcloud/bigquery/test_job.py

Copy file name to clipboardExpand all lines: gcloud/bigquery/test_job.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,13 @@ def test_reload_w_alternate_client(self):
10871087
self._verifyResourceProperties(job, RESOURCE)
10881088

10891089

1090-
class TestRunQueryJob(unittest2.TestCase, _Base):
1090+
class TestRunAsyncQueryJob(unittest2.TestCase, _Base):
10911091
JOB_TYPE = 'query'
10921092
QUERY = 'select count(*) from persons'
10931093

10941094
def _getTargetClass(self):
1095-
from gcloud.bigquery.job import RunQueryJob
1096-
return RunQueryJob
1095+
from gcloud.bigquery.job import RunAsyncQueryJob
1096+
return RunAsyncQueryJob
10971097

10981098
def _verifyBooleanResourceProperties(self, job, config):
10991099

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.