Skip to content

[do not merge]: Dry run for packages/google-cloud-spanner migration#16058

Open
parthea wants to merge 1062 commits intomainfrom
migration.python-spanner.migration.2026-03-09_19-45-52.migrate
Open

[do not merge]: Dry run for packages/google-cloud-spanner migration#16058
parthea wants to merge 1062 commits intomainfrom
migration.python-spanner.migration.2026-03-09_19-45-52.migrate

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 9, 2026

See #10952.

This PR should be merged with a merge-commit, not a squash-commit, in order to preserve the git history.

gcf-owl-bot bot and others added 30 commits November 3, 2023 07:31
Source-Link: googleapis/synthtool@bc07fd4
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:30470597773378105e239b59fce8eb27cc97375580d592699206d17d117143d0

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@febaccc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:caffe0a9277daeccc4d1de5c9b55ebba0901b57c2f713ec9c876b0d4ec064f61

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…tion (#1032)

* Executing existing DDL statements on executemany statement execution

* Fixing test

* Added more tests and resolved comments

* Fixing test

* Resolved comments
…mit) (#1037)

* Implementing client side statement in dbapi starting with commit

* Fixing comments

* Adding dependency on "deprecated" package

* Fix in setup.py

* Fixing tests

* Lint issue fix

* Resolving comments

* Fixing formatting issue
* chore: Update gapic-generator-python to v1.12.0

PiperOrigin-RevId: 586356061

Source-Link: googleapis/googleapis@72a1f55

Source-Link: googleapis/googleapis-gen@558a04b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9

* 🦉 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.13.0

PiperOrigin-RevId: 586460538

Source-Link: googleapis/googleapis@44582d0

Source-Link: googleapis/googleapis-gen@5e7073c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: added Generator API
docs: updated doc for speech mode

PiperOrigin-RevId: 586469693

Source-Link: googleapis/googleapis@e8148d6

Source-Link: googleapis/googleapis-gen@85136bd
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9

* 🦉 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>
* chore(python): Add Python 3.12

Source-Link: googleapis/synthtool@af16e6d
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5

* Update trove classifier to include python 3.12

* Update required checks to include all samples presubmits

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* feat: Introduce compatibility with native namespace packages

* update .coveragerc to reflect changes

* remove replacement in owlbot.py

* exclude coverage for .nox/* and /tmp/*
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
* feat: Batch Write API implementation and samples

* Update sample

* review comments

* return public class for mutation groups

* Update google/cloud/spanner_v1/batch.py

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>

* Update google/cloud/spanner_v1/batch.py

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>

* review comments

* remove doc

* feat(spanner): nit sample data refactoring

* review comments

* fix test

---------

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
Co-authored-by: Sri Harsha CH <sriharshach@google.com>
)

* fix: Refactoring tests to use fixtures properly

* Not using autouse fixtures for few tests where not needed

* feat: Implementation for Begin and Rollback clientside statements

* Incorporating comments

* Formatting

* Comments incorporated

* Fixing tests

* Small fix

* Test fix as emulator was going OOM
…lates/python_library/.kokoro (#1043)

Source-Link: googleapis/synthtool@9367caa
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f155882785883336b4468d5218db737bb1d10c9cea7cb62219ad16fe248c03c

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* Implementation of client side statements that return

* Small fix

* Incorporated comments

* Added tests for exception in commit and rollback

* Fix in tests

* Skipping few tests from running in emulator

* Few fixes

* Refactoring

* Incorporated comments

* Incorporating comments
* feat: Implementation for batch dml in dbapi

* Few changes

* Incorporated comments
…hecks (#1062)

* chore: dummy commit

* chore: edit yaml

* chore: revert lint

* chore: remove python versions

* chore: reduce emulator version to 1.5.12

* chore: revert to latest
* test: unit test case fix

* feat(spanner): lint

---------

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
Co-authored-by: Sri Harsha CH <sriharshach@google.com>
* changes

* changes

* docs

* docs

* linting

* feat(spanner): remove client side validations for directed read options

* feat(spanner): update the auto_failover_disabled field

* feat(spanner): update unit tests

* feat(spanner): update test

* feat(spanner): update documentation

* feat(spanner): add system test to validate exception in case of RW transaction

* feat(spanner): update unit test

* feat(spanner): add dro for batchsnapshot and update system tests

* feat(spanner): fix unit tests for batchsnapshot

* feat(spanner): add unit tests for partition read and query

* feat(spanner): lint fixes

* feat(spanner): code refactor remove TransactionType

* feat(spanner): comment refactor

* feat(spanner): remove comments

---------

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
Co-authored-by: Sri Harsha CH <sriharshach@google.com>
* feat: Implementation for partitioned query in dbapi

* Comments incorporated and added more tests

* Small fix

* Test fix

* Removing ClientSideStatementParamKey enum

* Comments incorporated
…1071)

* fix: Fix for flaky test_read_timestamp_client_side_autocommit test

* Adding a row between 2 transactions so that read timestamp are different for the 2 transactions

---------

Co-authored-by: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@fac8444
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5ea6d0ab82c956b50962f91d94e206d3921537ae5fe1549ec5326381d8905cfa

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…dding interceptors support for testing (#1056)

* feat: Fixing and refactoring transaction retry logic in dbapi. Also adding interceptors support for testing

* Comments incorporated and changes for also storing Cursor object with the statements details added for retry

* Some refactoring of transaction_helper.py and maintaining state of rows update count for batch dml in cursor

* Small fix

* Maintaining a map from cursor to last statement added in transaction_helper.py

* Rolling back the transaction when Aborted exception is thrown from interceptor

* Small change

* Disabling a test for emulator run

* Reformatting
* feat(spanner): add proto and enum types

PiperOrigin-RevId: 599046867

Source-Link: googleapis/googleapis@64a5bfe

Source-Link: googleapis/googleapis-gen@6e96ab8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmU5NmFiOGJiMWVjNDUzNmM1YTBjNGQwOTVmNTNjZTA1NzhjYjhhNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add max_commit_delay API

PiperOrigin-RevId: 599315735

Source-Link: googleapis/googleapis@465a103

Source-Link: googleapis/googleapis-gen@930e231
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwZTIzMThhY2JkMTBmYjU0ZDg2NjhkMmYyY2YxOWZlNDEzZDVhOSJ9

* 🦉 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: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com>
* feat: Implementation of run partition query

* Comments incorporated

* Comments incorporated

* Comments incorporated
* feat(spanner): add proto descriptors for proto and enum types in create/update/get database ddl requests

PiperOrigin-RevId: 601013501

Source-Link: googleapis/googleapis@81b24a5

Source-Link: googleapis/googleapis-gen@46f0446
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZmMDQ0NjAzNzkwNmYwZDkwNTM2NTgzNWYwMmE2NTIyNDFmM2RlMyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add FLOAT32 enum to TypeCode

PiperOrigin-RevId: 601176446

Source-Link: googleapis/googleapis@584ecd4

Source-Link: googleapis/googleapis-gen@0bdb815
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGJkYjgxNTc3OWQwZmQ3ODI0YmFmZmYwYzkxMDQ2YTdkY2E1Y2Q1ZiJ9

* 🦉 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>
aseering and others added 4 commits March 3, 2026 15:31
Re-opening #1495 due to permissions issues.

Thank you for opening a Pull Request! Before submitting your PR, there
are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/python-spanner/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

---------

Co-authored-by: Knut Olav Løite <koloite@gmail.com>
…into migration.python-spanner.migration.2026-03-09_19-45-52.migrate
@parthea parthea changed the title chore(migration): Migrate code from googleapis/python-spanner into packages/google-cloud-spanner [do not merge]: Dry run for packages/google-cloud-spanner migration Mar 9, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on migrating the Cloud Spanner library's codebase to a new location while ensuring that the project's history is maintained. It also introduces new configuration files for development and code quality.

Highlights

  • Code Migration: This pull request migrates the Cloud Spanner code from the googleapis/python-spanner repository into the packages/google-cloud-spanner directory.
  • Git History Preservation: The PR should be merged using a merge-commit to preserve the git history, as requested in the associated issue.
  • New Files: Several new files related to coverage, development container configuration, and linting have been added to the packages/google-cloud-spanner directory.
Activity
  • The pull request involves a migration of code from one repository to another.
  • It also includes the addition of several configuration files to the new location.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request appears to be a large-scale migration for the google-cloud-spanner package. The changes introduce a vast number of new configuration files, documentation, and scripts. My review has identified several critical issues that will cause CI failures, particularly in the GitHub Actions workflows due to an invalid action version, and in a benchmark script that uses Python 2 syntax in a Python 3+ environment. Additionally, there are high-severity inconsistencies in dependency management and several medium-severity issues related to outdated documentation and configuration file formatting. Addressing these issues will be crucial for the stability and maintainability of the package.

Note: Security Review did not run due to the size of the PR.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/google-cloud-spanner/.github/workflows/presubmit.yaml (36)

critical

The action actions/setup-python@v6 is not a valid version and will cause this workflow to fail. The latest stable version is v5. Please update to a valid version.

        uses: actions/setup-python@v5

packages/google-cloud-spanner/benchmark/ycsb.py (148)

critical

The .itervalues() method is a Python 2 feature. In Python 3, you should use .values(). This code will fail at runtime. Additionally, the list comprehension is redundant; you can pass the values() view directly to sum().

    overall_op_count = sum(op_counts.values())

packages/google-cloud-spanner/.github/workflows/integration-tests-against-emulator.yaml (22)

critical

The action actions/setup-python@v6 is not a valid version and will cause this workflow to fail. The latest stable version is v5. Please update to a valid version. Also, consider using stable action versions like actions/checkout@v4 instead of pre-releases like v5 for better stability.

        uses: actions/setup-python@v5

packages/google-cloud-spanner/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml (22)

critical

The action actions/setup-python@v6 is not a valid version and will cause this workflow to fail. The latest stable version is v5. Please update to a valid version. Also, consider using stable action versions like actions/checkout@v4 instead of pre-releases like v5 for better stability.

        uses: actions/setup-python@v5

packages/google-cloud-spanner/.github/workflows/presubmit.yaml (18)

critical

The action actions/setup-python@v6 is not a valid version and will cause this workflow to fail. The latest stable version is v5. Please update to a valid version. This issue is also present in the units job.

        uses: actions/setup-python@v5

packages/google-cloud-spanner/benchmark/ycsb.py (146-147)

critical

The .iteritems() method is specific to Python 2 and has been removed in Python 3. Since this project requires Python 3.9+, this will cause a runtime AttributeError. Please use the .items() method instead.

    op_counts = {operation: len(latency) for operation, latency in latencies_ms.items()}

packages/google-cloud-spanner/.github/workflows/mock_server_tests.yaml (15)

critical

The action actions/setup-python@v6 is not a valid version and will cause this workflow to fail. The latest stable version is v5. Please update to a valid version. Also, consider using stable action versions like actions/checkout@v4 instead of pre-releases like v5 for better stability.

        uses: actions/setup-python@v5

packages/google-cloud-spanner/.devcontainer/Dockerfile (16)

high

The apt-key command is deprecated and its usage is discouraged for security reasons. It's recommended to download the GPG key and store it directly in /usr/share/keyrings. Additionally, combining apt-get commands into a single RUN instruction and cleaning up the apt cache (/var/lib/apt/lists/*) would optimize the Docker image size and build time.

RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && apt-get update -y && apt-get install -y google-cloud-cli

packages/google-cloud-spanner/.devcontainer/requirements.in (1)

high

The version of nox specified here (2024.10.9) is inconsistent with requirements.txt, which lists nox==2025.5.1. Since requirements.txt is generated from this file, they should be in sync. Please update this file to match the version in requirements.txt and regenerate it to ensure a reproducible environment.

nox==2025.5.1

packages/google-cloud-spanner/.github/header-checker-lint.yml (15)

medium

This file does not end with a newline character. It's a good practice for all text files to end with a newline for POSIX compatibility and to avoid issues with some tools.

packages/google-cloud-spanner/.librarian/generator-input/librarian.py (213)

medium

The unit_test_python_versions list includes Python 3.7 and 3.8. However, other configuration files in this PR, such as setup.py (python_requires=">=3.9") and noxfile.py, indicate that support starts from Python 3.9. To ensure consistency across the project's configuration, please remove Python 3.7 and 3.8 from this list.

    unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

packages/google-cloud-spanner/CONTRIBUTING.rst (25)

medium

The list of supported Python versions is missing Python 3.14, which is included in the test matrix in noxfile.py and listed in setup.py. Please update the documentation to reflect this.

  3.9, 3.10, 3.11, 3.12, 3.13, and 3.14 on both UNIX and Windows.

packages/google-cloud-spanner/.devcontainer/postCreate.sh (3)

medium

The file does not end with a newline character. According to POSIX standards, a text file should end with a newline. Some tools may not process the last line correctly without it.

packages/google-cloud-spanner/.devcontainer/requirements.in (1)

medium

The file does not end with a newline character. It is a POSIX standard and a general best practice for text files to end with a newline to ensure they are processed correctly by various tools.

@chalmerlowe chalmerlowe force-pushed the migration.python-spanner.migration.2026-03-09_19-45-52.migrate branch from f9e7d87 to d4bff6e Compare March 13, 2026 14:13
@chalmerlowe chalmerlowe marked this pull request as ready for review March 16, 2026 20:22
@chalmerlowe chalmerlowe requested review from a team as code owners March 16, 2026 20:22
@snippet-bot
Copy link

snippet-bot bot commented Mar 16, 2026

Here is the summary of changes.

You are about to add 141 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.