#29118: Uncertainty in proper signature for resolve_expression method
-------------------------------------+-------------------------------------
               Reporter:  Raphael    |          Owner:  nobody
  Gaschignard                        |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  2.0
  layer (models, ORM)                |
               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          |
-------------------------------------+-------------------------------------
 In {{{BaseExpression}}} we have the following:


 {{{
     def resolve_expression(self, query=None, allow_joins=True, reuse=None,
 summarize=False, for_save=False):
           ...
 }}}

 Here we have a couple default arguments. A decent number of callsites for
 this method only provide positional arguments. The {{{Exists}}} subclass
 assumes keyword-only arguments:

 {{{
     def resolve_expression(self, query=None, **kwargs):
         # As a performance optimization, remove ordering since EXISTS
 doesn't
         # care about it, just whether or not a row matches.
         self.queryset = self.queryset.order_by()
         return super(Exists, self).resolve_expression(query, **kwargs)
 }}}

 I've submitted a patch ([https://github.com/django/django/pull/9671]) that
 adds support for positional arguments for {{{Exists.resolve_expression}}},
 but perhaps the intention was for the base method to be keyword-only.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29118>
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/047.cf92c3b7d70020d8270cd2d3c967a9e5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to