-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: return non existent snapshot if document not found instead of raising NotFound exception #5007
Firestore: return non existent snapshot if document not found instead of raising NotFound exception #5007
Conversation
… of raising NotFound exception
@@ -420,17 +419,11 @@ def get(self, field_paths=None, transaction=None): | |||
Returns: | |||
~.firestore_v1beta1.document.DocumentSnapshot: A snapshot of | |||
the current document. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -582,8 +582,7 @@ def _parse_batch_get(get_doc_response, reference_map, client): | |||
a document factory. | |||
|
|||
Returns: | |||
Optional[.DocumentSnapshot]: The retrieved snapshot. If the | |||
snapshot is :data:`None`, that means the document is ``missing``. | |||
Optional[.DocumentSnapshot]: The retrieved snapshot. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -420,17 +419,11 @@ def get(self, field_paths=None, transaction=None): | |||
Returns: | |||
~.firestore_v1beta1.document.DocumentSnapshot: A snapshot of | |||
the current document. | |||
|
|||
Raises: | |||
~google.cloud.exceptions.NotFound: If the document does not exist. | |||
""" | |||
snapshot_generator = self._client.get_all( | |||
[self], field_paths=field_paths, transaction=transaction) | |||
snapshot = _consume_single_get(snapshot_generator) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
# Create a minimal fake client with a dummy response. | ||
response_iterator = iter([None]) | ||
read_time = 123 | ||
snapshot = DocumentSnapshot(None, None, False, read_time, None, None) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
1f4d8d4
to
59ef5fc
Compare
@tseaver addressed your comments. thanks. I kept a lot of the unittest to not compare to |
closes #4809