Conversation
352dd6a to
dfdf577
Compare
dfdf577 to
c21c3fa
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses UUID serialization warnings by serializing uuid.UUID values as strings, and updates CI to adjust the Python/Django test matrix and GitHub Actions versions.
Changes:
- Serialize
uuid.UUIDfields asstrin_serialize_fieldto avoid JSON serialization warnings. - Remove Python 3.7 from the GitHub Actions matrix and update Actions used in the workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tracking_fields/tracking.py |
Adds explicit UUID handling in field serialization. |
.github/workflows/python-app.yml |
Updates Python version matrix and bumps GitHub Actions versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - django_version: '4.0' | ||
| python_version: '3.7' | ||
| python_version: '3.8' | ||
|
|
||
| - django_version: '4.1' | ||
| python_version: '3.7' | ||
| python_version: '3.8' | ||
|
|
||
| - django_version: '4.2' | ||
| python_version: '3.7' | ||
| python_version: '3.8' |
There was a problem hiding this comment.
The matrix exclude list was previously excluding Python 3.7 for Django 4.x (unsupported). Now that 3.7 is removed from the matrix, these entries were changed to exclude Python 3.8 instead, which is a supported combination for Django 4.0/4.1/4.2 and is also covered in tox. This unintentionally drops CI coverage for Python 3.8 on Django 4.x; remove these exclude items (or adjust them to only exclude truly unsupported pairs, e.g. Django 4.0 with Python 3.11).
| if isinstance(field, uuid.UUID): | ||
| return json.dumps(str(field), ensure_ascii=False) |
There was a problem hiding this comment.
This adds special-casing for uuid.UUID serialization, but there is no test asserting the resulting stored values (and that the warning log path is no longer used). Please add/extend a test that tracks a UUIDField (or tracks the UUID primary key) and asserts the persisted TrackedFieldModification JSON contains the plain UUID string rather than a UUID('...') repr, and ideally that no serialization warning is emitted.
Il y avait des warnings lors de la sérialization d'un objet UUID.