You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 2, 2026. It is now read-only.
When it doesn't contain the id_token attribute, AttributeError is raised.
Before checking if id_token is None, we should check if the attribute exists using hasattr()
Environment details
OS type and version: Mac OS X (Darwin mac-mini.lan 20.5.0)
Python version: 3.8.8
pip version: 21.1.2
google-cloud-firestore version: 2.3.0
Steps to reproduce
run unit test that reads and writes Firestore document using firebase-emulator:exec
Code example
omitted since it's a straightforward bug.
Stack trace
File "/opt/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/document.py", line 167, in set
write_results = batch.commit(**kwargs)
File "/opt/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/batch.py", line 59, in commit
commit_response = self._client._firestore_api.commit(
File "/opt/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/client.py", line 109, in _firestore_api
return self._firestore_api_helper(
File "/opt/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/base_client.py", line 152, in _firestore_api_helper
channel = self._emulator_channel(transport)
File "/opt/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/base_client.py", line 183, in _emulator_channel
if self._credentials is not None and self._credentials.id_token is not None:
AttributeError: 'Credentials' object has no attribute 'id_token'