GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: support inline-begin in mock server by olavloite · Pull Request #1271 · googleapis/python-spanner

This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Conversation

@olavloite

@olavloite olavloite commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

Adds support for inline-begin in the mock server.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite
test: support inline-begin in mock server
d3ce683
@olavloite
olavloite requested review from a team and harshachinta December 16, 2024 17:12
@blunderbuss-gcf blunderbuss-gcf Bot assigned sakthivelmanii Dec 16, 2024
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/python-spanner API. labels Dec 16, 2024
@olavloite
olavloite requested review from aakashanandg and removed request for harshachinta December 20, 2024 10:16
@olavloite
Merge branch 'main' into support-inline-begin-in-mock-server
3dff625
aakashanandg
aakashanandg reviewed Dec 20, 2024
View reviewed changes
Comment thread google/cloud/spanner_v1/testing/mock_spanner.py
partials.append(partial)
partials[len(partials) - 1].stats = result.stats
if started_transaction:
partials[0].metadata.transaction = started_transaction

@aakashanandg aakashanandg Dec 20, 2024

Copy link
Copy Markdown
Contributor

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.

Is there a specific reason we're including the transaction object details with the first partial result set?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@olavloite olavloite Dec 20, 2024

Copy link
Copy Markdown
Contributor Author

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.

Yes, that is how the Spanner API works:

  1. The first PartialResultSet in a stream should always contain the metadata for the query result. The remaining PartialResultSets will not have this field set.
  2. If the request (e.g. the ExecuteSqlRequest) contained a BeginTransaction option, then the metadata should also include the transaction ID of the transaction that was started as a side-effect of executing the request.

See https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#google.spanner.v1.TransactionSelector for a bit more background information.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aakashanandg
aakashanandg approved these changes Dec 20, 2024
View reviewed changes

@aakashanandg aakashanandg left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM. I just added a question for clarification on why we're including the transaction details with only a single partial result set

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite
olavloite merged commit 6352dd2 into main Dec 20, 2024
@olavloite
olavloite deleted the support-inline-begin-in-mock-server branch December 20, 2024 14:29
@odeke-em odeke-em mentioned this pull request Mar 2, 2026
testing/mock_spanner: failure with TypeError: unsupported operand type(s) for |: 'MessageMeta' and 'MessageMeta' googleapis/google-cloud-python#15901
Open
aakashanandg pushed a commit to aakashanandg/python-spanner that referenced this pull request Jan 2, 2025
@olavloite @aakashanandg
test: support inline-begin in mock server (googleapis#1271)
076d330
@waiho-gumloop waiho-gumloop mentioned this pull request Feb 28, 2026
DBAPI: transaction_checkout() uses explicit BeginTransaction RPC instead of inline begin googleapis/google-cloud-python#15871
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@aakashanandg aakashanandg aakashanandg approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@sakthivelmanii sakthivelmanii

Labels

api: spanner Issues related to the googleapis/python-spanner API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@olavloite @aakashanandg @sakthivelmanii
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.