-
Couldn't load subscription status.
- Fork 6.6k
Replace the Datastore and Firestore locational endpoints URL examples #13607
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
base: main
Are you sure you want to change the base?
Conversation
… with regional endpoints URLs
Summary of ChangesHello @aristide-n, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the example code for Google Cloud Datastore and Firestore to reflect current best practices for connecting to these services. Specifically, it replaces outdated locational endpoint URLs with the appropriate regional endpoint URLs in the provided Python snippets, ensuring the samples are accurate and functional. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the example endpoint URLs for Datastore and Firestore to use regional endpoints instead of multi-regional ones. The changes are correct, but I've suggested a minor improvement in the Firestore snippet to add the https:// scheme to the endpoint URL for consistency and to follow API documentation.
| def regional_endpoint(): | ||
| # [START firestore_regional_endpoint] | ||
| ENDPOINT = "nam5-firestore.googleapis.com" | ||
| ENDPOINT = "firestore.africa-south1.rep.googleapis.com" |
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.
For consistency with the Datastore snippet in this same pull request, and to align with the google-api-core ClientOptions documentation (which states api_endpoint should be the full URL including the scheme), it's better to include the https:// prefix here.
| ENDPOINT = "firestore.africa-south1.rep.googleapis.com" | |
| ENDPOINT = "https://firestore.africa-south1.rep.googleapis.com" |
| from google.api_core.client_options import ClientOptions | ||
|
|
||
| ENDPOINT = "https://nam5-datastore.googleapis.com" | ||
| ENDPOINT = "https://datastore.africa-south1.rep.googleapis.com" |
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.
Is there a reason why these are changing from North America multi-regional to Johannesburg regional? Is it because we don't want to use us-central1 as default?
Description
Replace the Datastore and Firestore locational endpoints URL examples with regional endpoints URLs
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)