]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Update argument name for distinct() to match docs
authorMichael Williamson <mike@zwobble.org>
Wed, 11 Apr 2018 15:21:20 +0000 (11:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 11 Apr 2018 15:21:20 +0000 (11:21 -0400)
A tiny change so that the docs are more consistent. At the moment, the same argument is given two different names.

Change-Id: Ic487006887d048700f260b2ae4a05d9a380412c1
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/439

lib/sqlalchemy/orm/query.py

index 043be55397dd9127050efa2d99fd0dddffbd6c0a..54be930559685e97c8814f0b562d059d90ec5e78 100644 (file)
@@ -2644,7 +2644,7 @@ class Query(object):
         self._offset = offset
 
     @_generative(_no_statement_condition)
-    def distinct(self, *criterion):
+    def distinct(self, *expr):
         r"""Apply a ``DISTINCT`` to the query and return the newly resulting
         ``Query``.
 
@@ -2662,18 +2662,18 @@ class Query(object):
             :attr:`.Query.statement` accessor, however.
 
         :param \*expr: optional column expressions.  When present,
-         the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>>)``
+         the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>)``
          construct.
 
         """
-        if not criterion:
+        if not expr:
             self._distinct = True
         else:
-            criterion = self._adapt_col_list(criterion)
+            expr = self._adapt_col_list(expr)
             if isinstance(self._distinct, list):
-                self._distinct += criterion
+                self._distinct += expr
             else:
-                self._distinct = criterion
+                self._distinct = expr
 
     @_generative()
     def prefix_with(self, *prefixes):