Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: make get_query_results private. Return rows for QueryJob.result() #3883

Merged
merged 1 commit into from
Sep 8, 2017

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Aug 25, 2017

Based on feedback from others in the redesign plan.

The get_query_results() function is too low level to expose directly to users.

The result() object should just return the rows as an iterator. This simplifies the proposed query interface to:

job = client.query('MY QUERY')
rows = job.result()

No need for separate fetch_data() call after calling result().

…sult()

get_query_results is too low level to expose directly to users.

Based on feedback from others in the redesign plan, the result() object
should just return the rows as an iterator. This simplifies the proposed
query interface to:

    job = client.query('MY QUERY')
    rows = job.result()

No need for separate fetch_data() call after calling result().
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 25, 2017
@dhermes dhermes added the api: bigquery Issues related to the BigQuery API. label Aug 25, 2017
Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially LGTM, though I'm not sure about one thing

@@ -154,7 +154,7 @@ def execute(self, operation, parameters=None, job_id=None):

# Wait for the query to finish.
try:
query_job = query_job.result()
query_job.result()
except google.cloud.exceptions.GoogleCloudError:
raise exceptions.DatabaseError(query_job.errors)

This comment was marked as spam.

This comment was marked as spam.

@tswast tswast merged commit e716fbe into googleapis:master Sep 8, 2017
@tswast tswast deleted the bq-queryresults branch September 8, 2017 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants