Skip to content

chore(migration): Migrate code from googleapis/python-spanner-django into packages/django-google-spanner#16045

Draft
parthea wants to merge 562 commits intomainfrom
migration.python-spanner-django.migration.2026-03-06_19-24-38.migrate
Draft

chore(migration): Migrate code from googleapis/python-spanner-django into packages/django-google-spanner#16045
parthea wants to merge 562 commits intomainfrom
migration.python-spanner-django.migration.2026-03-06_19-24-38.migrate

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Mar 6, 2026

See #10953.

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

odeke-em and others added 30 commits April 6, 2020 16:53
Changing nullability of fields with indexes from Meta.indexes isn't
supported.

refs #378
…talled

If setup.py imports django_spanner, Django and google.api_core.datetime_helpers
must be installed before django-spanner.

Regression in 3a244267ffc6cabe847511896a0616fa161d3bfe.
Detail how to run the Django test suite apps with the
2 different methods:
* directly with django_test_suite.sh
* by parallelization with ./bin/parallelize_linux
Audited and ran modeladmin and all tests passed with

```shell
test_actions_not_unique (modeladmin.test_checks.ActionsCheckTests) ... ok
test_actions_unique (modeladmin.test_checks.ActionsCheckTests) ... ok
test_custom_permissions_require_matching_has_method (modeladmin.test_checks.ActionsCheckTests) ... ok
test_autocomplete_e036 (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_e037 (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_e039 (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_e040 (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_e38 (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_is_onetoone (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_autocomplete_is_valid (modeladmin.test_checks.AutocompleteFieldsTests) ... ok
test_invalid_field_type (modeladmin.test_checks.DateHierarchyCheckTests) ... ok
test_missing_field (modeladmin.test_checks.DateHierarchyCheckTests) ... ok
test_related_invalid_field_type (modeladmin.test_checks.DateHierarchyCheckTests) ... ok
test_related_valid_case (modeladmin.test_checks.DateHierarchyCheckTests) ... ok
test_valid_case (modeladmin.test_checks.DateHierarchyCheckTests) ... ok
test_not_integer (modeladmin.test_checks.ExtraCheckTests) ... ok
test_valid_case (modeladmin.test_checks.ExtraCheckTests) ... ok
test_duplicate_fields_in_fields (modeladmin.test_checks.FieldsCheckTests) ... ok
test_inline (modeladmin.test_checks.FieldsCheckTests) ... ok
test_duplicate_fields (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_duplicate_fields_in_fieldsets (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_fieldsets_with_custom_form_validation (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_item_not_a_pair (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_missing_fields_key (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_non_iterable_item (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_second_element_of_item_not_a_dict (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_specified_both_fields_and_fieldsets (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FieldsetsCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.FilterHorizontalCheckTests) ... ok
test_missing_field (modeladmin.test_checks.FilterHorizontalCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.FilterHorizontalCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FilterHorizontalCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.FilterVerticalCheckTests) ... ok
test_missing_field (modeladmin.test_checks.FilterVerticalCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.FilterVerticalCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FilterVerticalCheckTests) ... ok
test_missing_field (modeladmin.test_checks.FkNameCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FkNameCheckTests) ... ok
test_fieldsets_with_custom_form_validation (modeladmin.test_checks.FormCheckTests) ... ok
test_invalid_type (modeladmin.test_checks.FormCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FormCheckTests) ... ok
test_inline_without_formset_class (modeladmin.test_checks.FormsetCheckTests) ... ok
test_invalid_type (modeladmin.test_checks.FormsetCheckTests) ... ok
test_valid_case (modeladmin.test_checks.FormsetCheckTests) ... ok
test_invalid_callable (modeladmin.test_checks.InlinesCheckTests) ... ok
test_invalid_model (modeladmin.test_checks.InlinesCheckTests) ... ok
test_invalid_model_type (modeladmin.test_checks.InlinesCheckTests) ... ok
test_missing_model_field (modeladmin.test_checks.InlinesCheckTests) ... ok
test_not_correct_inline_field (modeladmin.test_checks.InlinesCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.InlinesCheckTests) ... ok
test_not_model_admin (modeladmin.test_checks.InlinesCheckTests) ... ok
test_valid_case (modeladmin.test_checks.InlinesCheckTests) ... ok
test_both_list_editable_and_list_display_links (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_list_display_first_item_in_list_editable (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_list_display_first_item_in_list_editable_no_list_display_links (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_list_display_first_item_same_as_list_editable_first_item (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_list_display_first_item_same_as_list_editable_no_list_display_links (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_list_display_links_is_none (modeladmin.test_checks.ListDisplayEditableTests) ... ok
test_None_is_valid_case (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_list_display_link_checked_for_list_tuple_if_get_list_display_overridden (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_list_display_links_check_skipped_if_get_list_display_overridden (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_missing_field (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_missing_in_list_display (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_valid_case (modeladmin.test_checks.ListDisplayLinksCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.ListDisplayTests) ... ok
test_missing_field (modeladmin.test_checks.ListDisplayTests) ... ok
test_not_iterable (modeladmin.test_checks.ListDisplayTests) ... ok
test_valid_case (modeladmin.test_checks.ListDisplayTests) ... ok
test_callable (modeladmin.test_checks.ListFilterTests) ... ok
test_list_filter_is_func (modeladmin.test_checks.ListFilterTests) ... ok
test_list_filter_validation (modeladmin.test_checks.ListFilterTests) ... ok
test_missing_field (modeladmin.test_checks.ListFilterTests) ... ok
test_not_associated_with_field_name (modeladmin.test_checks.ListFilterTests) ... ok
test_not_callable (modeladmin.test_checks.ListFilterTests) ... ok
test_not_filter (modeladmin.test_checks.ListFilterTests) ... ok
test_not_filter_again (modeladmin.test_checks.ListFilterTests) ... ok
test_not_filter_again_again (modeladmin.test_checks.ListFilterTests) ... ok
test_not_list_filter_class (modeladmin.test_checks.ListFilterTests) ... ok
test_valid_case (modeladmin.test_checks.ListFilterTests) ... ok
test_not_integer (modeladmin.test_checks.ListMaxShowAllCheckTests) ... ok
test_valid_case (modeladmin.test_checks.ListMaxShowAllCheckTests) ... ok
test_not_integer (modeladmin.test_checks.ListPerPageCheckTests) ... ok
test_valid_case (modeladmin.test_checks.ListPerPageCheckTests) ... ok
test_invalid_type (modeladmin.test_checks.ListSelectRelatedCheckTests) ... ok
test_valid_case (modeladmin.test_checks.ListSelectRelatedCheckTests) ... ok
test_not_integer (modeladmin.test_checks.MaxNumCheckTests) ... ok
test_valid_case (modeladmin.test_checks.MaxNumCheckTests) ... ok
test_not_integer (modeladmin.test_checks.MinNumCheckTests) ... ok
test_valid_case (modeladmin.test_checks.MinNumCheckTests) ... ok
test_invalid_expression (modeladmin.test_checks.OrderingCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.OrderingCheckTests) ... ok
test_random_marker_not_alone (modeladmin.test_checks.OrderingCheckTests) ... ok
test_valid_case (modeladmin.test_checks.OrderingCheckTests) ... ok
test_valid_complex_case (modeladmin.test_checks.OrderingCheckTests) ... ok
test_valid_expression (modeladmin.test_checks.OrderingCheckTests) ... ok
test_valid_random_marker_case (modeladmin.test_checks.OrderingCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_missing_field (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_missing_field_again (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_not_dictionary (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_not_list_or_tuple (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_one_to_one_field (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_valid_case (modeladmin.test_checks.PrepopulatedFieldsCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.RadioFieldsCheckTests) ... ok
test_invalid_value (modeladmin.test_checks.RadioFieldsCheckTests) ... ok
test_missing_field (modeladmin.test_checks.RadioFieldsCheckTests) ... ok
test_not_dictionary (modeladmin.test_checks.RadioFieldsCheckTests) ... ok
test_valid_case (modeladmin.test_checks.RadioFieldsCheckTests) ... ok
test_invalid_field_type (modeladmin.test_checks.RawIdCheckTests) ... ok
test_missing_field (modeladmin.test_checks.RawIdCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.RawIdCheckTests) ... ok
test_valid_case (modeladmin.test_checks.RawIdCheckTests) ... ok
test_not_boolean (modeladmin.test_checks.SaveAsCheckTests) ... ok
test_valid_case (modeladmin.test_checks.SaveAsCheckTests) ... ok
test_not_boolean (modeladmin.test_checks.SaveOnTopCheckTests) ... ok
test_valid_case (modeladmin.test_checks.SaveOnTopCheckTests) ... ok
test_not_iterable (modeladmin.test_checks.SearchFieldsCheckTests) ... ok
test_inline_admin_inherited_valid (modeladmin.test_has_add_permission_obj_deprecation.HasAddPermissionObjTests) ... ok
test_inline_admin_valid (modeladmin.test_has_add_permission_obj_deprecation.HasAddPermissionObjTests) ... ok
test_inline_admin_warning (modeladmin.test_has_add_permission_obj_deprecation.HasAddPermissionObjTests) ... ok
test_model_admin_inherited_valid (modeladmin.test_has_add_permission_obj_deprecation.HasAddPermissionObjTests) ... ok
test_model_admin_valid (modeladmin.test_has_add_permission_obj_deprecation.HasAddPermissionObjTests) ... ok
test_has_add_permission (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_has_change_permission (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_has_delete_permission (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_has_module_permission (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_has_view_permission (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_inline_has_add_permission_uses_obj (modeladmin.tests.ModelAdminPermissionTests) ... ok
test_inline_has_add_permission_without_obj (modeladmin.tests.ModelAdminPermissionTests) ... ok

----------------------------------------------------------------------
Ran 164 tests in 352.354s

OK
Destroying test database for alias 'default' ('test_oc42e8b2e0cd42c90f326')...
```
Despite us getting a quota bump, we continue to see
errors related to creating instances, for example:
https://source.cloud.google.com/results/invocations/7a40c996-e090-495d-945f-8d74f67d8473/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-spanner-django%2Fpresubmit%2Fworker_0/log

    panic: rpc error: code = ResourceExhausted desc = Project 1065521786570 cannot add 1 nodes in region us-west2.

This change lookups the zone and then extrapolates the region
to use when creating the Cloud Spanner instance.
Regression in ff3f43d897c54e3a678811d4f076956975ec721a.

fixes #427
* ci: skip test_readonly_root only on Kokoro

fixes #407

* ci: remove migration_test_data_persistence skip
fixes #408
Also while here, fixed a typo in a setting field for `DATABASES`
that used
    DATABASE
instead of
    NAME

for the name of the database.

Fixes #433
)

The proper name is data_type_check_constraints (no 's' after type) but
Spanner doesn't have check constraints anyway.

Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
renovate-bot and others added 24 commits April 17, 2024 15:18
* chore(deps): update all dependencies

* 🦉 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: Changes for release please

* Skipping timezone test
* chore(main): release 3.1.0

* Update CHANGELOG.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Ankit Agarwal <146331865+ankiaga@users.noreply.github.com>
* feat: Changes for Django 4.2

* 🦉 Updates from OwlBot post-processor

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

* 🦉 Updates from OwlBot post-processor

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

* 🦉 Updates from OwlBot post-processor

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

* Adding allow_transactions_in_auto_commit property

* 🦉 Updates from OwlBot post-processor

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

* Comments incorporated

* 🦉 Updates from OwlBot post-processor

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

* 🦉 Updates from OwlBot post-processor

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

* Update README.rst

Co-authored-by: Knut Olav Løite <koloite@gmail.com>

* Update README.rst

Co-authored-by: Knut Olav Løite <koloite@gmail.com>

* Update README.rst

Co-authored-by: Knut Olav Løite <koloite@gmail.com>

* Update django_spanner/base.py

Co-authored-by: Knut Olav Løite <koloite@gmail.com>

* Comments incorporated

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Knut Olav Løite <koloite@gmail.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: Fixing README.rst to fix release failure.

googleapis/python-spanner-django#883

* More changes

* More changes
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
#914)

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

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

Source-Link: googleapis/synthtool@106d292
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8ff1efe878e18bd82a0fb7b70bb86f77e7ab6901fed394440b6135db0ba8d84a

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* test: add mockserver tests

* 🦉 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>
* test: add mockserver tests

* 🦉 Updates from OwlBot post-processor

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

* fix: add option to disable client-side pk generation

Add an option to disable client-side generation of primary key values.
This makes it possible to use the Spanner Django dialect in combination
with other Django dialects, without the Spanner Django PK generation
interfering with the other dialect(s).

Fixes #783

* chore: introduce configuration option for id generation

Adds a configuration option for enabling/disabling client-side ID generation
using a random UUID. This allows users to better control ID generation when
using non-Spanner databases in combination with Spanner.

This option can in the future also be used for using IDENTITY columns for
ID generation.

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* fix: move version module to

* 🦉 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: Knut Olav Løite <koloite@gmail.com>
Co-authored-by: Knut Olav Løite <koloite@gmail.com>
Document how to enable/disable randomly generated primary key values.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Towards googleapis/librarian#2460

---------

Co-authored-by: ohmayr <omairn@google.com>
…/main' into migration.python-spanner-django.migration.2026-03-06_19-24-38.migrate
@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 undertakes a significant structural reorganization by migrating the python-spanner-django project into a dedicated packages/django-google-spanner directory. This move aims to centralize the project's assets, including its source code, documentation, and testing infrastructure, into a more organized and maintainable layout. The changes ensure that the project continues to provide robust Cloud Spanner integration for Django applications, with updated development workflows and enhanced observability features.

Highlights

  • Project Migration: The entire python-spanner-django project has been migrated into the packages/django-google-spanner directory, consolidating its codebase, documentation, and tests under a new, standardized path within the repository.
  • Core Functionality Preservation: Existing Spanner-specific database operations, schema management, and Django compatibility logic have been moved and integrated into the new structure, ensuring no loss of functionality during the migration.
  • Build and Test Infrastructure: New Nox configurations (noxfile.py) and shell scripts (django_test_suite_3.2.sh, django_test_suite_4.2.sh) have been added to manage testing across different Django versions and to streamline the build process.
  • Documentation and Metadata Updates: Comprehensive documentation (under docs/), contribution guidelines (CONTRIBUTING.md), a code of conduct (CODE_OF_CONDUCT.md), and repository metadata (.repo-metadata.json) have been added or updated to reflect the new project structure and standards.
  • OpenTelemetry Tracing Integration: OpenTelemetry tracing utilities have been introduced (django_spanner/_opentelemetry_tracing.py) and integrated into schema operations, allowing for better observability of database interactions.
Changelog
  • packages/django-google-spanner/.coveragerc
    • Added a new coverage configuration file.
  • packages/django-google-spanner/.gitignore
    • Added a new gitignore file for the package.
  • packages/django-google-spanner/.librarian/state.yaml
    • Added librarian state configuration.
  • packages/django-google-spanner/.repo-metadata.json
    • Added repository metadata for the django-google-spanner project.
  • packages/django-google-spanner/CHANGELOG.md
    • Added the project's changelog, detailing releases up to 4.0.2.
  • packages/django-google-spanner/CODE_OF_CONDUCT.md
    • Added a Contributor Code of Conduct.
  • packages/django-google-spanner/CONTRIBUTING.md
    • Added contribution guidelines.
  • packages/django-google-spanner/LICENSE
    • Added the BSD license file.
  • packages/django-google-spanner/README.rst
    • Added the main README file for the package.
  • packages/django-google-spanner/SECURITY.md
    • Added a security policy document.
  • packages/django-google-spanner/create_test_instance.py
    • Added a script to create a Spanner test instance.
  • packages/django-google-spanner/django_spanner/init.py
    • Added the package's initialization file, including AutoField monkey-patching and Django compatibility checks.
  • packages/django-google-spanner/django_spanner/_opentelemetry_tracing.py
    • Added OpenTelemetry tracing utilities.
  • packages/django-google-spanner/django_spanner/base.py
    • Added the core DatabaseWrapper implementation for Spanner.
  • packages/django-google-spanner/django_spanner/client.py
    • Added the DatabaseClient for Spanner.
  • packages/django-google-spanner/django_spanner/compiler.py
    • Added custom SQL compiler logic for Spanner.
  • packages/django-google-spanner/django_spanner/creation.py
    • Added database creation and test skipping logic.
  • packages/django-google-spanner/django_spanner/functions.py
    • Added custom SQL function registrations.
  • packages/django-google-spanner/django_spanner/introspection.py
    • Added Spanner-specific database introspection.
  • packages/django-google-spanner/django_spanner/lookups.py
    • Added custom Django lookup implementations for Spanner.
  • packages/django-google-spanner/django_spanner/operations.py
    • Added Spanner-specific database operations.
  • packages/django-google-spanner/django_spanner/schema.py
    • Added Spanner-specific schema editor logic.
  • packages/django-google-spanner/django_spanner/utils.py
    • Added utility functions for Django compatibility and SQL modification.
  • packages/django-google-spanner/django_spanner/version.py
    • Added the package version file.
  • packages/django-google-spanner/django_test_apps.txt
    • Added a list of Django test applications.
  • packages/django-google-spanner/django_test_suite_3.2.sh
    • Added a shell script for running Django 3.2 test suite.
  • packages/django-google-spanner/django_test_suite_4.2.sh
    • Added a shell script for running Django 4.2 test suite.
  • packages/django-google-spanner/docs/README.rst
    • Added documentation README.
  • packages/django-google-spanner/docs/_static/custom.css
    • Added custom CSS for documentation.
  • packages/django-google-spanner/docs/_templates/layout.html
    • Added custom layout for documentation.
  • packages/django-google-spanner/docs/api-reference.rst
    • Added API reference documentation.
  • packages/django-google-spanner/docs/base-api.rst
    • Added base API documentation.
  • packages/django-google-spanner/docs/compiler-api.rst
    • Added compiler API documentation.
  • packages/django-google-spanner/docs/conf.py
    • Added Sphinx configuration for documentation.
  • packages/django-google-spanner/docs/creation-api.rst
    • Added creation API documentation.
  • packages/django-google-spanner/docs/example_from_scratch.md
    • Added example documentation.
  • packages/django-google-spanner/docs/example_healthchecks.md
    • Added example documentation.
  • packages/django-google-spanner/docs/expressions-api.rst
    • Added expressions API documentation.
  • packages/django-google-spanner/docs/functions-api.rst
    • Added functions API documentation.
  • packages/django-google-spanner/docs/index.rst
    • Added main documentation index.
  • packages/django-google-spanner/docs/introspection-api.rst
    • Added introspection API documentation.
  • packages/django-google-spanner/docs/limitations-spanner.rst
    • Added Spanner-specific limitations documentation.
  • packages/django-google-spanner/docs/limitations.rst
    • Added general limitations documentation.
  • packages/django-google-spanner/docs/lookups-api.rst
    • Added lookups API documentation.
  • packages/django-google-spanner/docs/operations-api.rst
    • Added operations API documentation.
  • packages/django-google-spanner/docs/samples.rst
    • Added samples documentation.
  • packages/django-google-spanner/docs/schema-api.rst
    • Added schema API documentation.
  • packages/django-google-spanner/docs/utils-api.rst
    • Added utilities API documentation.
  • packages/django-google-spanner/examples/from-scratch/README.md
    • Added example README.
  • packages/django-google-spanner/examples/healthchecks/README.md
    • Added example README.
  • packages/django-google-spanner/foreign_key_test.sh
    • Added a foreign key test script.
  • packages/django-google-spanner/noxfile.py
    • Added Nox configuration for testing and building.
  • packages/django-google-spanner/pyproject.toml
    • Added Black configuration.
  • packages/django-google-spanner/renovate.json
    • Added Renovate configuration.
  • packages/django-google-spanner/run_testing_worker.py
    • Added a script for running testing workers.
  • packages/django-google-spanner/setup.cfg
    • Added Flake8 and isort configuration.
  • packages/django-google-spanner/setup.py
    • Added the package setup file.
  • packages/django-google-spanner/testing/constraints-3.6.txt
    • Added dependency constraints for testing.
  • packages/django-google-spanner/tests/init.py
    • Added test package initialization.
  • packages/django-google-spanner/tests/_helpers.py
    • Added test helper utilities, including OpenTelemetry base class.
  • packages/django-google-spanner/tests/conftest.py
    • Added Pytest configuration.
  • packages/django-google-spanner/tests/mockserver_tests/mock_database_admin.py
    • Added mock Spanner Database Admin servicer.
  • packages/django-google-spanner/tests/mockserver_tests/mock_server_test_base.py
    • Added base class for mock server tests.
  • packages/django-google-spanner/tests/mockserver_tests/mock_spanner.py
    • Added mock Spanner servicer.
  • packages/django-google-spanner/tests/mockserver_tests/models.py
    • Added models for mock server tests.
  • packages/django-google-spanner/tests/mockserver_tests/spanner_database_admin_pb2_grpc.py
    • Added gRPC generated code for Database Admin.
  • packages/django-google-spanner/tests/mockserver_tests/spanner_pb2_grpc.py
    • Added gRPC generated code for Spanner.
  • packages/django-google-spanner/tests/mockserver_tests/test_basics.py
    • Added basic mock server tests.
  • packages/django-google-spanner/tests/performance/init.py
    • Added performance test package initialization.
  • packages/django-google-spanner/tests/performance/django_spanner/init.py
    • Added performance test package initialization.
  • packages/django-google-spanner/tests/performance/django_spanner/models.py
    • Added models for performance tests.
  • packages/django-google-spanner/tests/performance/django_spanner/test_benchmark.py
    • Added benchmark tests.
  • packages/django-google-spanner/tests/settings.py
    • Added Django settings for tests.
  • packages/django-google-spanner/tests/system/init.py
    • Added system test package initialization.
  • packages/django-google-spanner/tests/system/django_spanner/models.py
    • Added models for system tests.
  • packages/django-google-spanner/tests/system/django_spanner/test_check_constraint.py
    • Added system tests for check constraints.
  • packages/django-google-spanner/tests/system/django_spanner/test_decimal.py
    • Added system tests for decimal fields.
  • packages/django-google-spanner/tests/system/django_spanner/test_json_field.py
    • Added system tests for JSON fields.
  • packages/django-google-spanner/tests/system/django_spanner/test_queries.py
    • Added system tests for queries.
  • packages/django-google-spanner/tests/system/django_spanner/utils.py
    • Added utilities for system tests.
  • packages/django-google-spanner/tests/unit/django_spanner/models.py
    • Added models for unit tests.
  • packages/django-google-spanner/tests/unit/django_spanner/simple_test.py
    • Added simple unit test base class.
  • packages/django-google-spanner/tests/unit/django_spanner/test__opentelemetry_tracing.py
    • Added unit tests for OpenTelemetry tracing.
  • packages/django-google-spanner/tests/unit/django_spanner/test_base.py
    • Added unit tests for DatabaseWrapper.
  • packages/django-google-spanner/tests/unit/django_spanner/test_client.py
    • Added unit tests for DatabaseClient.
  • packages/django-google-spanner/tests/unit/django_spanner/test_compiler.py
    • Added unit tests for SQL compiler.
  • packages/django-google-spanner/tests/unit/django_spanner/test_expressions.py
    • Added unit tests for expressions.
  • packages/django-google-spanner/tests/unit/django_spanner/test_functions.py
    • Added unit tests for custom functions.
  • packages/django-google-spanner/tests/unit/django_spanner/test_introspection.py
    • Added unit tests for database introspection.
  • packages/django-google-spanner/tests/unit/django_spanner/test_lookups.py
    • Added unit tests for custom lookups.
  • packages/django-google-spanner/tests/unit/django_spanner/test_operations.py
    • Added unit tests for database operations.
  • packages/django-google-spanner/tests/unit/django_spanner/test_schema.py
    • Added unit tests for schema editor.
  • packages/django-google-spanner/tests/unit/django_spanner/test_utils.py
    • Added unit tests for utility functions.
  • scripts/split_repo_migration/single-library.git-migrate-history.sh
    • Modified git clone and tree-filter commands to include an additional --recurse-submodules flag, ensuring proper handling of nested submodules during the migration process.
Activity
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 migrates the python-spanner-django library into the monorepo. The changes are extensive as they include the entire codebase and configuration files. My review focused on identifying potential issues introduced during the migration, such as outdated configurations, inconsistencies, and minor bugs. I've found several issues, primarily in the CI/CD configuration files, where incorrect paths could lead to build failures. I've also noted some critical inconsistencies in documentation regarding Python version requirements, which have been highlighted with reference to repository guidelines on breaking changes. Additionally, there are a few minor code improvements. Overall, the migration looks good, but these issues should be addressed to ensure a smooth transition and maintainability.

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

packages/django-google-spanner/.kokoro/samples/python3.10/periodic-head.cfg (9-10)

high

The TRAMPOLINE_BUILD_FILE path appears to be incorrect. It points to a file in the python-pubsub repository, which is likely a copy-paste error. It should probably point to a file within the python-spanner-django repository, such as .kokoro/test-samples-against-head.sh.

    key: "TRAMPOLINE_BUILD_FILE"
    value: "github/python-spanner-django/.kokoro/test-samples-against-head.sh"

packages/django-google-spanner/.kokoro/samples/python3.6/periodic-head.cfg (9-10)

high

The TRAMPOLINE_BUILD_FILE path appears to be incorrect. It points to a file in the python-pubsub repository, which is likely a copy-paste error. It should probably point to a file within the python-spanner-django repository, such as .kokoro/test-samples-against-head.sh.

    key: "TRAMPOLINE_BUILD_FILE"
    value: "github/python-spanner-django/.kokoro/test-samples-against-head.sh"

packages/django-google-spanner/.kokoro/samples/python3.7/periodic-head.cfg (9-10)

high

The TRAMPOLINE_BUILD_FILE path appears to be incorrect. It points to a file in the python-pubsub repository, which is likely a copy-paste error. It should probably point to a file within the python-spanner-django repository, such as .kokoro/test-samples-against-head.sh.

    key: "TRAMPOLINE_BUILD_FILE"
    value: "github/python-spanner-django/.kokoro/test-samples-against-head.sh"

packages/django-google-spanner/.kokoro/samples/python3.8/periodic-head.cfg (9-10)

high

The TRAMPOLINE_BUILD_FILE path appears to be incorrect. It points to a file in the python-pubsub repository, which is likely a copy-paste error. It should probably point to a file within the python-spanner-django repository, such as .kokoro/test-samples-against-head.sh.

    key: "TRAMPOLINE_BUILD_FILE"
    value: "github/python-spanner-django/.kokoro/test-samples-against-head.sh"

packages/django-google-spanner/.kokoro/samples/python3.9/periodic-head.cfg (9-10)

high

The TRAMPOLINE_BUILD_FILE path appears to be incorrect. It points to a file in the python-pubsub repository, which is likely a copy-paste error. It should probably point to a file within the python-spanner-django repository, such as .kokoro/test-samples-against-head.sh.

    key: "TRAMPOLINE_BUILD_FILE"
    value: "github/python-spanner-django/.kokoro/test-samples-against-head.sh"

packages/django-google-spanner/README.rst (72)

high

The README states that the minimum required Python version is 3.6. However, setup.py specifies python_requires=">=3.8". This inconsistency is critical. Given the setup.py configuration, the README should be updated to state Python 3.8 as the minimum version. Note that changing the minimum supported Python version is a breaking change in environment requirements, which typically warrants a minor version bump to allow for patching previous versions, as per repository guidelines.

The minimum required Python version is 3.8.
References
  1. Updating the minimum supported Python version from 3.6 to 3.8 constitutes a breaking change in environment requirements. Repository guidelines suggest a minor version bump for such changes to ensure proper versioning and support for users on older environments.

packages/django-google-spanner/setup.py (74)

high

The python_requires is set to >=3.8, which contradicts the README that states Python 3.6 is the minimum supported version. This inconsistency is critical. Please ensure all documentation and configuration files are consistent regarding the minimum Python version. If the minimum Python version is indeed 3.8, this represents a breaking change in environment requirements, which typically warrants a minor version bump to allow for patching previous versions, as per repository guidelines.

References
  1. Updating the minimum supported Python version from 3.6 to 3.8 constitutes a breaking change in environment requirements. Repository guidelines suggest a minor version bump for such changes to ensure proper versioning and support for users on older environments.

packages/django-google-spanner/.github/workflows/integration-tests-against-emulator-3.10.yml (21)

medium

There's a typo in the step name. It should be "Set up Python 3.10" to match the Python version being set up in this workflow.

      - name: Set up Python 3.10

packages/django-google-spanner/CHANGELOG.md (7)

medium

The release date (2025-06-05) is in the future. This is likely a typo and should be corrected to the actual release date.

packages/django-google-spanner/django_spanner/init.py (70-75)

medium

The comments on lines 72 and 74 refer to a DISABLE_RANDOM_ID_GENERATION setting, but the code uses RANDOM_ID_GENERATION_ENABLED. To avoid confusion, the comments should be updated to use the correct setting name.

packages/django-google-spanner/django_spanner/base.py (155)

medium

The user_agent is hardcoded to an old version string "django_spanner/2.2.0a1". This should be dynamically set using the __version__ from django_spanner.version to ensure it's always up-to-date. You'll need to import __version__ from .version at the top of the file.

            "user_agent": f"django_spanner/{__version__}",

@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.