From 07d6d211f23f1d9d1d69fd54e8054bccd515bc8c Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Thu, 16 Apr 2020 23:16:32 +0200 Subject: Deprecate ``DISTINCT ON`` when not targeting PostgreSQL Deprecate usage of ``DISTINCT ON`` in dialect other than PostgreSQL. Previously this was silently ignored. Deprecate old usage of string distinct in MySQL dialect Fixes: #4002 Change-Id: I38fc64aef75e77748083c11d388ec831f161c9c9 --- lib/sqlalchemy/sql/selectable.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/sqlalchemy/sql/selectable.py') diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 89ee7e28f..c8df637ba 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -4138,6 +4138,9 @@ class Select( the PostgreSQL dialect will render a ``DISTINCT ON (>)`` construct. + .. deprecated:: 1.4 Using \*expr in other dialects is deprecated + and will raise :class:`_exc.CompileError` in a future version. + """ if expr: self._distinct = True -- cgit v1.2.1