Skip to content

Conversation

daniel-sanche
Copy link
Member

Some of the datastore snippets are missing required imports. This change pulls the necessary imports into each sample in snippets.py

@daniel-sanche daniel-sanche requested review from a team as code owners September 17, 2024 20:42
@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: datastore Issues related to the Datastore API. labels Sep 17, 2024
@daniel-sanche daniel-sanche added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2024

def regional_endpoint():
# [START datastore_regional_endpoints]
from google.cloud import datastore

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?

Copy link
Member Author

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

Copy link

@gkevinzheng gkevinzheng left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@iennae iennae left a 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.

@iennae iennae merged commit 8fb8a65 into main Sep 20, 2024
15 checks passed
@iennae iennae deleted the improve_imports branch September 20, 2024 19:18
riathakkar pushed a commit to riathakkar/python-docs-samples that referenced this pull request Oct 8, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the Datastore API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants