From: Michael Williamson Date: Wed, 11 Apr 2018 15:21:20 +0000 (-0400) Subject: Update argument name for distinct() to match docs X-Git-Tag: rel_1_3_0b1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ca11d1b6a9f7743d684c83f2ecd29ea446e362f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Update argument name for distinct() to match docs 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 --- diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 043be55397..54be930559 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -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 (>)`` + the PostgreSQL dialect will render a ``DISTINCT ON ()`` 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):