8000 docs: clarified reference to project parameter (#6280) · bpeters/python-docs-samples@6bac124 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6bac124

Browse files
authored
docs: clarified reference to project parameter (GoogleCloudPlatform#6280)
* clarified reference to project parameter * refined comment for project parameter * updated async comment to match
1 parent c867efa commit 6bac124

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

firestore/cloud-async-client/snippets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ async def quickstart_new_instance():
2020
# [START firestore_setup_client_create_async]
2121
from google.cloud import firestore
2222

23-
# Project ID is determined by the GCLOUD_PROJECT environment variable
24-
db = firestore.AsyncClient()
23+
# The `project` parameter is optional and represents which project the client
24+
# will act on behalf of. If not supplied, the client falls back to the default
25+
# project inferred from the environment.
26+
db = firestore.AsyncClient(project='my-project-id')
2527
# [END firestore_setup_client_create_async]
2628

2729
return db

firestore/cloud-client/snippets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ def quickstart_new_instance():
2323
# [START firestore_setup_client_create]
2424
from google.cloud import firestore
2525

26-
# Project ID is determined by the GCLOUD_PROJECT environment variable
27-
db = firestore.Client()
26+
# The `project` parameter is optional and represents which project the client
27+
# will act on behalf of. If not supplied, the client falls back to the default
28+
# project inferred from the environment.
29+
db = firestore.Client(project='my-project-id')
2830
# [END firestore_setup_client_create]
2931

3032
return db

0 commit comments

Comments
 (0)
0