Skip to content

feat: migrate Django 5.2 upgrade and 3.2/4.2 deprecations#16624

Draft
sinhasubham wants to merge 3 commits intomainfrom
django_upgrade_5_2
Draft

feat: migrate Django 5.2 upgrade and 3.2/4.2 deprecations#16624
sinhasubham wants to merge 3 commits intomainfrom
django_upgrade_5_2

Conversation

@sinhasubham
Copy link
Copy Markdown
Contributor

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 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> 🦕

@sinhasubham sinhasubham changed the title Django upgrade 5 2 feat: migrate Django 5.2 upgrade and 3.2/4.2 deprecations Apr 13, 2026
Copy link
Copy Markdown
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 updates the Spanner database backend to support Django 5.2 and Python 3.10+, while removing legacy support for Django 3.2 and 4.2. Key changes include the implementation of a global client cache to prevent initialization crashes, support for JSONArray, GeneratedField, and db_default, and a retry mechanism for flushing tables with foreign key constraints. Feedback highlights several critical issues: the use of a 32-bit mask for primary key generation significantly reduces the key space, and making GOOGLE_CLOUD_PROJECT mandatory is a breaking change for local development. Additionally, the package version was incorrectly decremented, and a minor version bump was recommended for this release. Finally, using WHERE 1=1 was suggested as a more idiomatic alternative to WHERE true for flush operations.

Comment thread packages/django-google-spanner/django_spanner/__init__.py Outdated
Comment thread packages/django-google-spanner/django_spanner/base.py Outdated
Comment thread packages/django-google-spanner/django_spanner/base.py Outdated
Comment thread packages/django-google-spanner/django_spanner/version.py Outdated
Comment thread packages/django-google-spanner/django_spanner/operations.py Outdated
@sinhasubham sinhasubham force-pushed the django_upgrade_5_2 branch 4 times, most recently from 2b71c2a to f6098f1 Compare April 16, 2026 09:17
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.

1 participant