-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix: (datastore) add imports to snippets #12601
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
Conversation
|
||
def regional_endpoint(): | ||
# [START datastore_regional_endpoints] | ||
from google.cloud import datastore |
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.
Why is this the only sample that has this import?
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.
All the other ones also include the preamble, which imports datastore and creates the client
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
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.
recognizing that this is a pre-existing issue where there are a bunch of samples in one file rather than one sample per file, (hopefully this can get refactored and fixed in the future) but also wanting to help unblock getting this fixed so that samples are copy pastable where they are showing up in c.g.c approving this.
* add imports to snippets * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * added missing import --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Some of the datastore snippets are missing required imports. This change pulls the necessary imports into each sample in snippets.py