Title: [spanner] RequestOptions.transaction_tag is unexpectedly mutated to '' when passed to snapshot.read() · Issue #17902 · googleapis/google-cloud-python · GitHub
Open Graph Title: [spanner] RequestOptions.transaction_tag is unexpectedly mutated to '' when passed to snapshot.read() · Issue #17902 · googleapis/google-cloud-python
X Title: [spanner] RequestOptions.transaction_tag is unexpectedly mutated to '' when passed to snapshot.read() · Issue #17902 · googleapis/google-cloud-python
Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue When passing a RequestOptions instance with a transaction_tag to snapshot.read(), the transaction_tag at...
Open Graph Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue When passing a RequestOptions instance with a transaction_tag to...
X Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue When passing a RequestOptions instance with a transaction_tag to...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/17902
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[spanner] RequestOptions.transaction_tag is unexpectedly mutated to '' when passed to snapshot.read()","articleBody":"### Determine this is the right repository\n\n- [x] I determined this is the correct repository in which to report this bug.\n\n### Summary of the issue\n\nWhen passing a RequestOptions instance with a transaction_tag to snapshot.read(), the transaction_tag attribute of the original object is unexpectedly mutated to '' (empty string).\n\n### API client name and version\n\ngoogle-cloud-spanner==3.69.0 \n\n### Reproduction steps: code\n\nfrom google.cloud import spanner\nfrom google.cloud.spanner_v1.types import RequestOptions\n\nspanner_client = spanner.Client()\ninstance = spanner_client.instance(\"your-instance-id\")\ndatabase = instance.database(\"your-database-id\")\n\nrequest_opts = RequestOptions(transaction_tag=\"tran1\")\n\nprint(\"Before read:\", request_opts.transaction_tag)\n\nwith database.snapshot() as snapshot:\n snapshot.read(\n table=\"Singers\",\n columns=(\"SingerId\", \"FirstName\"),\n keyset=spanner.KeySet(all_=True),\n request_options=request_opts,\n )\n\nprint(\"After read:\", request_opts.transaction_tag)\n\n\n### Reproduction steps: supporting files\n\n_No response_\n\n### Reproduction steps: actual results\n\nBefore read: tran1\nAfter read:\n\n### Reproduction steps: expected results\n\nBefore read: tran1\nAfter read: tran1\n\n### OS & version + platform\n\nWindows 11\n\n### Python environment\n\nPython 3.14.6\n\n### Python dependencies\n\npip list\nPackage Version\n---------------------------------- ---------\ncertifi 2026.7.22\ncffi 2.1.0\ncharset-normalizer 3.4.9\ncryptography 49.0.0\ngoogle-api-core 2.33.0\ngoogle-auth 2.56.2\ngoogle-cloud-core 2.6.0\ngoogle-cloud-monitoring 2.31.0\ngoogle-cloud-spanner 3.69.0\ngoogle-cloud-storage 3.13.0\ngoogle-crc32c 1.8.0\ngoogle-resumable-media 2.10.0\ngoogleapis-common-protos 1.75.0\ngrpc-google-iam-v1 0.14.4\ngrpc-interceptor 0.15.4\ngrpcio 1.82.1\ngrpcio-status 1.82.1\nidna 3.18\nmmh3 5.2.1\nopentelemetry-api 1.44.0\nopentelemetry-resourcedetector-gcp 1.12.0a0\nopentelemetry-sdk 1.44.0\nopentelemetry-semantic-conventions 0.65b0\npip 26.1.2\nproto-plus 1.28.2\nprotobuf 7.35.1\npyasn1 0.6.4\npyasn1_modules 0.4.2\npycparser 3.0\nrequests 2.34.2\nsqlparse 0.5.5\ntyping_extensions 4.16.0\nurllib3 2.7.0\n\n### Additional context\n\nPassing an object as an argument should not destructively mutate the caller's input object.","author":{"url":"https://github.com/cbh34680","@type":"Person","name":"cbh34680"},"datePublished":"2026-07-26T00:32:24Z","url":"https://github.com/googleapis/google-cloud-python/issues/17902"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:73cfcc0f-3cc8-1c47-2d3e-7cd2dd191992 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85CC:38D83D:2489DE:3302C1:6AFE1A20 |
| html-safe-nonce | cbcbbc523aab560162684b759cd88d78bd18baa26b47f695359134f48acb0e2c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUNDOjM4RDgzRDoyNDg5REU6MzMwMkMxOjZBRkUxQTIwIiwidmlzaXRvcl9pZCI6IjQyMTI1MzY2ODM0Mjc0MDQzMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e0fe96d4b5f5a038dddaf14911fbb59c4c76528436e03e26ed5028f48163721e |
| hovercard-subject-tag | issue:4978388424 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/17902/issue_layout |
| twitter:image | https://opengraph.githubassets.com/188edcf997450cb873724399c9315f6556b0d72c72e1d034909928de43fc96d6/googleapis/google-cloud-python/issues/17902 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/188edcf997450cb873724399c9315f6556b0d72c72e1d034909928de43fc96d6/googleapis/google-cloud-python/issues/17902 |
| og:image:alt | Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue When passing a RequestOptions instance with a transaction_tag to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cbh34680 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef3993a71fa20f7be8e167132fbf9619bc66e12 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width