-
Notifications
You must be signed in to change notification settings - Fork 306
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
docs: Updates query to query and wait in client_query_w_positional_params.py
#1786
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
@@ -35,7 +35,9 @@ def client_query_w_positional_params() -> None: | |||
bigquery.ScalarQueryParameter(None, "INT64", 250), | |||
] | |||
) | |||
query_job = client.query(query, job_config=job_config) # Make an API request. | |||
query_job = client.query_and_wait( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this variable, as the return value is no longer a QueryJob object. Instead it is a RowIterator object. "rows" or "results" could be a good name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds good. Will correct that now.
query_job = client.query(query, job_config=job_config) # Make an API request. | ||
results = client.query_and_wait( | ||
query, job_config=job_config | ||
) # Make an API request. | ||
|
||
for row in query_job: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line needs to be updated too. The query_job
variable doesn't exist anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will correct now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕