]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
tighten up overwritten attribute detection and use a deprecation
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 May 2023 14:51:02 +0000 (10:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 May 2023 13:05:48 +0000 (09:05 -0400)
commit58400352607c315fda15903a9909b2e9a61114a5
tree65c6a45e8b8b3b73cfbbce4795cd35542e3cc065
parent2dced78f33010d4a6a6276f4e8c5665bd08d01c0
tighten up overwritten attribute detection and use a deprecation

A deprecation warning is emitted whenever a property is added to a
:class:`_orm.Mapper` where an ORM mapped property were already configured,
or an attribute is already present on the class. Previously, there was a
non-deprecation warning for this case that did not emit consistently. The
logic for this warning has been improved so that it detects end-user
replacement of attribute while not having false positives for internal
Declarative and other cases where replacement of descriptors with new ones
is expected.

Fixes: #9841
Change-Id: I21ef25571466eeca3fedbec71612f7553fdbf2bf
doc/build/changelog/unreleased_20/9841.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
test/aaa_profiling/test_memusage.py
test/orm/test_deprecations.py
test/orm/test_mapper.py
test/orm/test_query.py