Skip to content

Bump Django 4.2 and DRF 3.15.2

Erwan Rouchet requested to merge bump-django into master

https://redmine.teklia.com/issues/7215

Requires a new base image build: https://gitlab.teklia.com/arkindex/backend/-/pipelines/178545

  • Django tried to recreate the element_image_and_polygon check constraint, but I have confirmed that the generated SQL for the constraint has not changed at all. I have instead updated the initial migration to ignore this.
  • Django's ArrayField implementation now uses '{}'::uuid[] instead of ARRAY[]::uuid[] for empty UUID arrays in ElementPath. It makes zero difference in how the queries run. The diffs in this MR show {{}}, but that's because the sql_validation files are used as Python format strings, so we have to escape the brackets.
  • DRF got smarter and adds more validators than before, but some of them were duplicated or unwarranted, so I had to update or remove them.
  • Some of the validator updates were indeed useful, as their validation is now skipped when using PartialUpdate if their fields are not updated, so there actually were less queries in a few endpoints.
  • I found this bug in Django, which caused unexpected SQL queries when slicing a union with 0 items, which is what the DRF pagination does on ListEntityElements and ListTranscriptions with recursive=True when there are no results.
  • I pinned sqlparse for unit tests because CI was failing after an update. It used to not recognize the @> operator on paths, so it would show it as @ >, but it now understands it so I removed the space.
Edited by Erwan Rouchet

Merge request reports

Loading