]> 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)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Jun 2026 20:04:25 +0000 (16:04 -0400)
commit101fd7f9b31db22f6ca2efdd3384a1e2751890bd
tree19f3fe550b8759f05aa10fc8ffdd3f09004d79c3
parent7ed455b445a030721b2613a64d2aac5a7018b12f
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
doc/build/changelog/unreleased_20/13396.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
test/sql/test_compiler.py