Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datastore/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def regional_endpoint():
from google.cloud import datastore
from google.api_core.client_options import ClientOptions

ENDPOINT = "https://nam5-datastore.googleapis.com"
ENDPOINT = "https://datastore.africa-south1.rep.googleapis.com"
Copy link
Contributor

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?

client_options = ClientOptions(api_endpoint=ENDPOINT)
client = datastore.Client(client_options=client_options)

Expand Down
2 changes: 1 addition & 1 deletion firestore/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ def create_and_build_bundle():

def regional_endpoint():
# [START firestore_regional_endpoint]
ENDPOINT = "nam5-firestore.googleapis.com"
ENDPOINT = "firestore.africa-south1.rep.googleapis.com"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
ENDPOINT = "firestore.africa-south1.rep.googleapis.com"
ENDPOINT = "https://firestore.africa-south1.rep.googleapis.com"

client_options = ClientOptions(api_endpoint=ENDPOINT)
db = firestore.Client(client_options=client_options)

Expand Down