[Django] #35717: Reduce CreateCollation + RemoveCollation to nothing

49 views
Skip to first unread message

Django

unread,
Aug 29, 2024, 1:44:40 PM8/29/24
to django-...@googlegroups.com
#35717: Reduce CreateCollation + RemoveCollation to nothing
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: Adam Johnson
Johnson |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Migrations |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
These Postgres-specific operations should optimize into nothing, if they
create and remove the same collation.

I believe we need to implement `CreateCollation.reduce()` that returns an
empty list when the other operation is a `RemoveCollation` for the same
`(locale, provider, deterministic)` tuple. This can take inspiration from
`CreateModel.reduce()` which does similar when reducing to a
`DeleteModel`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35717>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 30, 2024, 10:51:48 AM8/30/24
to django-...@googlegroups.com
#35717: Reduce CreateCollation + RemoveCollation to nothing
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
Type: | Johnson
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted

Comment:

Thank you! [https://github.com/django/django/pull/18524 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35717#comment:1>

Django

unread,
Oct 9, 2024, 3:30:59 PM10/9/24
to django-...@googlegroups.com
#35717: Reduce CreateCollation + RemoveCollation to nothing
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
Type: | Johnson
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35717#comment:2>

Django

unread,
Oct 10, 2024, 7:18:55 AM10/10/24
to django-...@googlegroups.com
#35717: Reduce CreateCollation + RemoveCollation to nothing
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
Type: | Johnson
Cleanup/optimization | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"cee95e6172f2ea3dbf8cfd4214562cfc92f95392" cee95e61]:
{{{#!CommitTicketReference repository=""
revision="cee95e6172f2ea3dbf8cfd4214562cfc92f95392"
Fixed #35717 -- Reduced Create/RemoveCollation operations when optimizing
migrations.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35717#comment:3>
Reply all
Reply to author
Forward
0 new messages