-
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
Remove CreateIfMissing option #4654
Remove CreateIfMissing option #4654
Conversation
a5a2f5a
to
3471f13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems mostly OK but I worry that we are replacing CreateIfMissing
with Exists
in places where they aren't fully equivalent.
@@ -897,7 +893,7 @@ def pb_for_delete(document_path, option): | |||
""" | |||
write_pb = write_pb2.Write(delete=document_path) | |||
if option is not None: | |||
option.modify_write(write_pb, no_create_msg=NO_CREATE_ON_DELETE) | |||
option.modify_write(write_pb) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -252,10 +251,8 @@ def write_option(**kwargs): | |||
:meth:`~.DocumentReference.update` and | |||
:meth:`~.DocumentReference.delete`. | |||
|
|||
Exactly one of three keyword arguments must be provided: | |||
One of the following two keyword arguments must be provided: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -1216,6 +1217,9 @@ def _helper(self, option=None, do_transform=False, **write_kwargs): | |||
map_pb = document_pb2.MapValue(fields={ | |||
'yum': _value_pb(bytes_value=value), | |||
}) | |||
if isinstance(option, ExistsOption): | |||
write_kwargs = {'current_document' : {'exists': option._exists}} |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
3471f13
to
7758dbe
Compare
7758dbe
to
bd67ea7
Compare
bd67ea7
to
4024fcb
Compare
Closing this pull request The commits are in #4851 and can be reviewed commit by commit. |
Partial #4111