]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn for all unmapped expressions
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 24 Mar 2023 15:11:54 +0000 (11:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 24 Mar 2023 15:38:42 +0000 (11:38 -0400)
commitd998b550a1857bd9f3b2418e0ac1592c4cb70ef9
treea98387d2b94ae8cb7545323910c4d4d5a7d659fd
parentce4e1770f01a6c19d3a55621529e3f98607d7824
warn for all unmapped expressions

Expanded the warning emitted when a plain :func:`_sql.column` object is
present in a Declarative mapping to include any arbitrary SQL expression
that is not declared within an appropriate property type such as
:func:`_orm.column_property`, :func:`_orm.deferred`, etc. These attributes
are otherwise not mapped at all and remain unchanged within the class
dictionary. As it seems likely that such an expression is usually not
what's intended, this case now warns for all such otherwise ignored
expressions, rather than just the :func:`_sql.column` case.

Fixes: #9537
Change-Id: Ic4ca7a071a28adf4ea8680690025d927522a0805
doc/build/changelog/unreleased_20/9537.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_base.py
test/orm/declarative/test_basic.py
test/orm/inheritance/test_basic.py