-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS type and version: Win10/WSL2 with Ubuntu 22.04
- Python version: 3.10.13
- pip version: 23.3.1
google-cloud-firestoreversion: 2.13.1
Steps to reproduce
- Retrieve a collection with the firestore AsyncClient
- Get warning that synchronous client is used instead of asynchrounous one
Code example
client = firestore.AsyncClient(project=project, credentials=cred)
collection = client.async_client.collection(name)Stack trace
File "/home/user/mambaforge/envs/env-name/lib/python3.10/site-packages/google/cloud/firestore_v1/async_document.py", line 367, in get
response_iter = await self._client._firestore_api.batch_get_documents(
File "/home/user/mambaforge/envs/env-name/lib/python3.10/site-packages/google/cloud/firestore_v1/services/firestore/async_client.py", line 758, in batch_get_documents
response = rpc(
File "/home/user/mambaforge/envs/env-name/lib/python3.10/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
return wrapped_func(*args, **kwargs)
File "/home/user/mambaforge/envs/env-name/lib/python3.10/site-packages/google/api_core/retry.py", line 372, in retry_wrapped_func
return retry_target(
File "/home/user/mambaforge/envs/env-name/lib/python3.10/site-packages/google/api_core/retry.py", line 209, in retry_target
warnings.warn(_ASYNC_RETRY_WARNING)
UserWarning: Using the synchronous google.api_core.retry.Retry with asynchronous calls may lead to unexpected results. Please use google.api_core.retry_async.AsyncRetry instead.
Potential cause/solution
In the file google/cloud/firestore_v1/services/firestore/async_client.py the following import is made:
from google.api_core import retry as retriesI believe it should be:
from google.api_core import retry_async as retriesReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.