Skip to content

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Jan 3, 2016

This is towards #1288 in preparation for the upgrade to v1beta3. In particular, a single Mutation protobuf instance in v1beta3 is not sufficient to contain all changes to be committed, so we use the container that is up one level in the hierarchy.

@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Jan 3, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 3, 2016
@dhermes dhermes mentioned this pull request Jan 3, 2016
49 tasks
@@ -312,6 +312,7 @@ def commit(self, dataset_id, mutation_pb, transaction_id):
that was completed in the commit.
"""
request = _datastore_pb2.CommitRequest()
request.CopyFrom(commit_request)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@tseaver
Copy link
Contributor

tseaver commented Jan 7, 2016

It makes me queasy to think about reusing a batch or a transaction. If somebody wanted to examine the _commit_request after commit, that would be fine, but I don't see a case for resetting it.

This is towards googleapis#1288 in preparation for the upgrade to `v1beta3`.
In particular, a single `Mutation` protobuf instance in `v1beta3` is not
sufficient to contain all changes to be committed, so we use the
container that is up one level in the hierarchy.
@dhermes dhermes force-pushed the datastore-commit-use-commit-req branch from a1194f5 to 7f1b786 Compare January 7, 2016 23:01
@dhermes
Copy link
Contributor Author

dhermes commented Jan 7, 2016

OK. Should I file an issue to move the tombstone behavior into Batch? Also, would it be better to use the passed in commit_request after moving that behavior or should I do it in this PR?

PS I just rebased, had a merge issue.

@tseaver
Copy link
Contributor

tseaver commented Jan 7, 2016

I think we could just open an issue and go on.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 7, 2016

LGTY to merge?

@dhermes
Copy link
Contributor Author

dhermes commented Jan 7, 2016

Filed #1366

@tseaver
Copy link
Contributor

tseaver commented Jan 7, 2016

LGTM

dhermes added a commit that referenced this pull request Jan 7, 2016
Using protobuf CommitRequest in datastore Connection.commit.
@dhermes dhermes merged commit 972e875 into googleapis:master Jan 7, 2016
@dhermes dhermes deleted the datastore-commit-use-commit-req branch January 7, 2016 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the Datastore API. 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