-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
refactor(bigquery): update code samples to use strings for table and dataset IDs #9974
Conversation
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.
LGTM once a few nits have been addressed.
# [START bigquery_query_partitioned_table] | ||
from google.cloud import bigquery | ||
|
||
import datetime |
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.
Nit: Import built-in datetime
before "third-party" libraries like google-cloud-bigquery
.
# TODO(developer): Construct a BigQuery client object. | ||
# client = bigquery.Client() | ||
|
||
import datetime |
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.
Nit: Import built-ins in a group before google-cloud-bigquery
.
# client = bigquery.Client() | ||
|
||
import datetime | ||
import pytz |
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.
Nit: Import pytz
in same import group as google-cloud-bigquery
.
bigquery/samples/query_no_cache.py
Outdated
FROM `bigquery-public-data.samples.shakespeare` | ||
GROUP BY corpus; | ||
""" | ||
query_job = client.query(sql, job_config=job_config,) # Make an API request. |
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.
Nit: The linter might complain about the trailing comma here.
Towards #8989
Closes #9596
List of changes:
New samples:
Update existing samples: