[Django] #34247: Cannot resolve operation dependencies

12 views
Skip to first unread message

Django

unread,
Jan 9, 2023, 2:20:27 PM1/9/23
to django-...@googlegroups.com
#34247: Cannot resolve operation dependencies
----------------------------------------+------------------------
Reporter: michaelschem | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
----------------------------------------+------------------------
I've been having trouble regenerating all my Django migrations from
scratch. We have hundreds of models and many complex relationships. I kept
getting the error `Cannot resolve operation dependencies` when generating
and I noticed that proxy models that were foreign keys of other models
seemed to be the culprit. I've created a pr to fix the sort method to
ensure that proxy model based CreateModel and regular model CreateModel
operations are at the top.

https://github.com/django/django/pull/16438

--
Ticket URL: <https://code.djangoproject.com/ticket/34247>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 9, 2023, 2:25:46 PM1/9/23
to django-...@googlegroups.com
#34247: Cannot resolve operation dependencies
----------------------------+--------------------------------------
Reporter: Mike Schem | Owner: nobody

Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by Tim Graham):

* needs_tests: 0 => 1
* easy: 1 => 0


Comment:

You'll need to provide a minimal example to reproduce the issue so we can
better understand it. The patch also requires a regression test based on
that.

--
Ticket URL: <https://code.djangoproject.com/ticket/34247#comment:1>

Django

unread,
Jan 10, 2023, 1:57:12 AM1/10/23
to django-...@googlegroups.com
#34247: Cannot resolve operation dependencies
----------------------------+--------------------------------------
Reporter: Mike Schem | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => needsinfo


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

Django

unread,
Jan 10, 2023, 12:51:00 PM1/10/23
to django-...@googlegroups.com
#34247: Cannot resolve operation dependencies
----------------------------+--------------------------------------
Reporter: Mike Schem | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------

Comment (by Mike Schem):

Replying to [comment:1 Tim Graham]:


> You'll need to provide a minimal example to reproduce the issue so we
can better understand it. The patch also requires a regression test based
on that.

Yea, I've tried to come up with something, but no luck so far. I've only
been able to get this to fail on my project, and like I said, it has
hundreds of objects with complex relations. The code does fix the problem
and I see no downside to ordering proxy model and model creates at the top
before the sort, any reason not to just accept the PR?

Not sure if I'll be able to come up with something here.

--
Ticket URL: <https://code.djangoproject.com/ticket/34247#comment:3>

Django

unread,
Jan 10, 2023, 2:27:53 PM1/10/23
to django-...@googlegroups.com
#34247: Cannot resolve operation dependencies
----------------------------+--------------------------------------
Reporter: Mike Schem | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------

Comment (by Tim Graham):

We can't add code for a problem we don't fully understand, or else Django
would quickly become a mess. Without a test, we can't be sure the problem
is fixed and that the behavior won't regress in the future.

--
Ticket URL: <https://code.djangoproject.com/ticket/34247#comment:4>

Reply all
Reply to author
Forward
0 new messages