Skip to content

Reducing datastore commit reliance on structure of response. - #1314

Merged
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:datastore-commit-change-result
Dec 22, 2015
Merged

Reducing datastore commit reliance on structure of response.#1314
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:datastore-commit-change-result

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

Also moving out the response parsing into a helper which can
be monkey-patched out during testing.

This is for the v1beta2 to v1beta3 change. Currently the
CommitResponse object contains a single MutationResult that holds
an integer index_updates field and a repeated field (insert_auto_id_key)
of partial Keys that were completed in the commit.

In v1beta3, the CommitResponse directly holds the integer index_updates
as well as a list of MutationResults. Additionally, the definition of
MutationResult no longer has index_updates (obviously given the last
sentence) and no longer holds a list of Keys. Instead, it holds a single
Key in the key field. What's more, the list of MutationResults
corresponds to every single Entity modified in the commit. For those
where a partial Key was completed, the MutationResult.key holds the
new key. For those were no key was completed, MutationResult.key
is empty.

@dhermesdhermes added the api: datastore Issues related to the Datastore API. label Dec 22, 2015
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 22, 2015
@dhermesdhermes mentioned this pull request Dec 22, 2015
49 tasks
Also moving out the response parsing into a helper which can
be monkey-patched out during testing.
This is for the `v1beta2` to `v1beta3` change. Currently the
`CommitResponse` object contains a single `MutationResult` that holds
an integer `index_updates` field and a repeated field (`insert_auto_id_key`)
of partial `Key`s that were completed in the `commit`.
In `v1beta3`, the `CommitResponse` directly holds the integer `index_updates`
as well as a list of `MutationResult`s. Additionally, the definition of
`MutationResult` no longer has `index_updates` (obviously given the last
sentence) and no longer holds a list of `Key`s. Instead, it holds a single
`Key` in the `key` field. What's more, the list of `MutationResult`s
corresponds to every single `Entity` modified in the commit. For those
where a partial `Key` was completed, the `MutationResult.key` holds the
new key. For those were **no key was completed**, `MutationResult.key`
is empty.
@dhermes
dhermesforce-pushed the datastore-commit-change-result branch from c48c8bf to 607a05bCompareDecember 22, 2015 04:43

This comment was marked as spam.

This comment was marked as spam.

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

dhermes added a commit that referenced this pull request Dec 22, 2015
Reducing datastore commit reliance on structure of response.
@dhermes
dhermes merged commit e4c2819 into googleapis:masterDec 22, 2015
@dhermes
dhermes deleted the datastore-commit-change-result branch December 22, 2015 17:02
@dhermesdhermes mentioned this pull request Jan 25, 2016
parthea pushed a commit that referenced this pull request Mar 6, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Mar 9, 2026
* feat: add a last field in the PartialResultSet
docs: A comment for field `rows` in message `.google.spanner.v1.ResultSet` is changed
docs: A comment for field `stats` in message `.google.spanner.v1.ResultSet` is changed
docs: A comment for field `precommit_token` in message `.google.spanner.v1.ResultSet` is changed
docs: A comment for field `values` in message `.google.spanner.v1.PartialResultSet` is changed
docs: A comment for field `chunked_value` in message `.google.spanner.v1.PartialResultSet` is changed
docs: A comment for field `stats` in message `.google.spanner.v1.PartialResultSet` is changed
docs: A comment for field `precommit_token` in message `.google.spanner.v1.PartialResultSet` is changed
docs: A comment for message `ResultSetMetadata` is changed
docs: A comment for field `row_type` in message `.google.spanner.v1.ResultSetMetadata` is changed
docs: A comment for message `ResultSetStats` is changed
docs: A comment for field `query_plan` in message `.google.spanner.v1.ResultSetStats` is changed
docs: A comment for field `row_count_lower_bound` in message `.google.spanner.v1.ResultSetStats` is changed
PiperOrigin-RevId: 730849734
Source-Link: googleapis/googleapis@fe0fa26
Source-Link: googleapis/googleapis-gen@16051b5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTYwNTFiNTkxN2I3NWY2MDNjY2I1ZjQ3N2UyYTQ2NDdiYTExZmE4MiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to v1.23.2
PiperOrigin-RevId: 732281673
Source-Link: googleapis/googleapis@2f37e0a
Source-Link: googleapis/googleapis-gen@016b753
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDE2Yjc1MzhiYTVhNzk4ZjJhZTQyM2Q0Y2NkN2Y4MmIwNmNkZjZkMiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to v1.23.3
PiperOrigin-RevId: 732994462
Source-Link: googleapis/googleapis@50cbb15
Source-Link: googleapis/googleapis-gen@6ca4b87
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmNhNGI4NzMwYzRlNWNjN2QzZTU0MDQ5Y2JkNmY5OWQ4ZDdjYjMzYyJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* fix: Allow Protobuf 6.x
chore: Update gapic-generator-python to v1.23.5
PiperOrigin-RevId: 735388698
Source-Link: googleapis/googleapis@a3dda51
Source-Link: googleapis/googleapis-gen@c329c69
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzMyOWM2OTNkMmRhMDYzYTg5ZWNjMjllMTVkYzE5Njc2OWFhODU0YiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to 1.23.6
PiperOrigin-RevId: 738170370
Source-Link: googleapis/googleapis@3f1e17a
Source-Link: googleapis/googleapis-gen@9afd8c3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWFmZDhjMzNkNGNhZTYxMGI3NWZhNDk5OTI2NGVhOGM4YzY2YjlkMiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to 1.24.0
PiperOrigin-RevId: 747419463
Source-Link: googleapis/googleapis@340579b
Source-Link: googleapis/googleapis-gen@e8997ec
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTg5OTdlYzUxMzZlY2I2ZWQ5YTk2OWE0YzJmMTNiM2FiNmExN2MxMiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to 1.24.1
PiperOrigin-RevId: 748739072
Source-Link: googleapis/googleapis@b947e52
Source-Link: googleapis/googleapis-gen@8c5821a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGM1ODIxYWE2NWE5MjFkNTliM2Y3NjUzZDZmMzdjOWM2NzQxMGMyZiJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: rahul2393 <irahul@google.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastoreIssues related to the Datastore API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dhermes@tseaver@googlebot