]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
override get_select_precolumns() in StrSQLCompiler
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Jun 2026 12:49:30 +0000 (08:49 -0400)
committerMichael Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Jun 2026 20:05:26 +0000 (20:05 +0000)
commit1cf779b3f38404b07e4e2962e03154756debac06
tree13072e76261f2ca7475e5d8d5a6639636dc54c58
parent5a14e813937e9b8c39ebf1e0709e1bf56fa6d0d6
override get_select_precolumns() in StrSQLCompiler

Fixed issue where :meth:`_sql.Select.get_final_froms` would emit a
deprecation warning when the statement made use of the PostgreSQL-specific
expression argument to :meth:`_sql.Select.distinct`; the same spurious
warning would be emitted when stringifying such a statement without
explicitly using a PostgreSQL dialect.  The fix ensures that this 1.4-era
warning is suppressed under both 2.0 and 2.1.

Note that under SQLAlchemy 2.1, passing an expression to
:meth:`_sql.Select.distinct` is deprecated overall, and is replaced by a
new PostgreSQL-specific construct (see :ticket:`12342`).

Fixes: #13396
Change-Id: I587e24aa7016c56b1d5bfe1048c4b6eb809dfb30
(cherry picked from commit d011fcf9c2532abeae5a686db78b6c1ad1318bce)
doc/build/changelog/unreleased_20/13396.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
test/sql/test_compiler.py