Skip to content
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

Firestore client v1.8.0 doesn't work with latest google.api_core #82

Closed
hiranya911 opened this issue Jul 7, 2020 · 2 comments · Fixed by #83
Closed

Firestore client v1.8.0 doesn't work with latest google.api_core #82

hiranya911 opened this issue Jul 7, 2020 · 2 comments · Fixed by #83
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API.

Comments

@hiranya911
Copy link

Environment details

  • OS type and version: Mac
  • Python version: Python 3.6.8
  • pip version: pip 20.1.1
  • google-cloud-firestore version: 1.8.0

Steps to reproduce

  1. Install the latest google-cloud-firestore in a fresh virtualenv sandbox.
Installing collected packages: pytz, six, protobuf, googleapis-common-protos, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, idna, chardet, urllib3, certifi, requests, grpcio, google-api-core, google-cloud-core, google-cloud-firestore
Successfully installed cachetools-4.1.1 certifi-2020.6.20 chardet-3.0.4 google-api-core-1.21.0 google-auth-1.18.0 google-cloud-core-1.3.0 google-cloud-firestore-1.8.0 googleapis-common-protos-1.52.0 grpcio-1.30.0 idna-2.10 protobuf-3.12.2 pyasn1-0.4.8 pyasn1-modules-0.2.8 pytz-2020.1 requests-2.24.0 rsa-4.6 six-1.15.0 urllib3-1.25.9
  1. Try to run any Firestore API call

Code example

from google.cloud import firestore

db = firestore.Client()
doc = db.collection('users').document('test').get()

Stack trace

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    doc = db.collection('users').document('test').get()
  File "/Users/hkj/Projects/firebase-admin-python/temp/py3/lib/python3.6/site-packages/google/cloud/firestore_v1/collection.py", line 109, in document
    return self._client.document(*child_path)
  File "/Users/hkj/Projects/firebase-admin-python/temp/py3/lib/python3.6/site-packages/google/cloud/firestore_v1/client.py", line 313, in document
    base_path = self._database_string + "/documents/"
  File "/Users/hkj/Projects/firebase-admin-python/temp/py3/lib/python3.6/site-packages/google/cloud/firestore_v1/client.py", line 190, in _database_string
    self.project, self._database
  File "/Users/hkj/Projects/firebase-admin-python/temp/py3/lib/python3.6/site-packages/google/cloud/firestore_v1/gapic/firestore_client.py", line 105, in database_root_path
    return google.api_core.path_template.expand(
AttributeError: module 'google.api_core' has no attribute 'path_template'

Issue originally reported in firebase/firebase-admin-python#475 but is easily reproducible without Firebase Admin SDK as well.

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Jul 7, 2020
@hiranya911
Copy link
Author

Seems like the broken bit of code was added in the last release that went out today.

@hiranya911 hiranya911 changed the title Firestore client doesn't work with latest google.api_core Firestore client v1.8.0 doesn't work with latest google.api_core Jul 7, 2020
@crwilcox crwilcox self-assigned this Jul 7, 2020
crwilcox added a commit to crwilcox/python-firestore that referenced this issue Jul 7, 2020
@crwilcox
Copy link
Contributor

crwilcox commented Jul 7, 2020

Cause was a fix to our generation that didn't add this line back. Issue to track getting a systest in place to catch this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants