Skip to content

Use Collection.stream instead of deprecated Collection.get in firestore#2240

Merged
gguuss merged 1 commit intoGoogleCloudPlatform:masterfrom
petervandenabeele:fix-firebase-get-deprecation-warnings
Jul 18, 2019
Merged

Use Collection.stream instead of deprecated Collection.get in firestore#2240
gguuss merged 1 commit intoGoogleCloudPlatform:masterfrom
petervandenabeele:fix-firebase-get-deprecation-warnings

Conversation

@petervandenabeele
Copy link
Contributor

Fixing these deprecations (since 1.2.0 ?) when running pytest with google-cloud-firestore==1.2.0

snippets_test.py::test_quickstart_get_collection
  /Users/peter_v/data/projects/secretjobs/git/scraping/code/development/firestore/cloud-client/snippets.py:62: DeprecationWarning: 'Collection.get' is deprecated:  please use 'Collection.stream' instead.
    docs = users_ref.get()

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 26, 2019
@petervandenabeele petervandenabeele changed the title Use Collection.stream instead of deprecated Collection.get Use Collection.stream instead of deprecated Collection.get in firestore Jun 26, 2019
@petervandenabeele
Copy link
Contributor Author

Note: this is the API documentation for the deprecated get:
https://googleapis.github.io/google-cloud-python/latest/firestore/collection.html#google.cloud.firestore_v1.collection.CollectionReference.get

get(transaction=None)[source]
    Deprecated alias for stream().

Copy link
Contributor

@gguuss gguuss left a comment

Choose a reason for hiding this comment

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

Thank you for the pull request, LGTM!

@gguuss gguuss merged commit 729e37f into GoogleCloudPlatform:master Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants