From 6ca11d1b6a9f7743d684c83f2ecd29ea446e362f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 11 Apr 2018 11:21:20 -0400 Subject: [PATCH] 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 --- lib/sqlalchemy/orm/query.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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): -- 2.47.2