#24525: AssertionError at `Query.change_aliases`
-------------------------------------+-------------------------------------
     Reporter:  coolRR               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.7
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Christian KarriƩ):

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


Comment:

 Hi all, unfortunately I have to reopen this issue.

 After migrating from Django 1.10.6 to 1.11.9 the error reoccurs:

 Code:


 {{{
 qs_out = qs.filter(*out_filters)
 qs_in = qs.filter(*in_filters)
 qs_merged = qs_in | qs_out
 }}}

 Vars:

 `in_filters = [<Q: (NOT (AND: ('contract__customer_id', 1)))>, <Q: (NOT
 (AND: ('contract__category__deletion', True)))>, <Q: (NOT (AND:
 ('contract__date_from__lte', datetime.date(2018, 1, 10)),
 ('contract__category__blocked', True), ('contract__date_until__gte',
 datetime.date(2018, 1, 10))))>, <Q: (AND: ('id', 0))>]`
 `out_filters = [<Q: (OR: (AND: (NOT (AND: ('contract__source_customer_id',
 1))), ('contract__customer_id', 1)), (AND: (NOT (AND:
 ('contract__source_customer_id', 1))), (NOT (AND:
 ('contract__customer_id', 1)))))>, <Q: (NOT (AND:
 ('contract__category__incoming', True)))>]`

 It seems to fail, if `qs_in` or `qs_out` is empty. But I'm not sure.

 Printing `change_map` gives me:


 {{{
 {'T7': u'invoice_customer', u'invoice_customer': 'T7'}
 }}}

 Removing the assert works.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.08779b54ed1729045e8c6bbdc89561a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to