]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Bypass declared_attr w/ a custom wrapper for lambda criteria
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Apr 2021 00:30:14 +0000 (20:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Apr 2021 00:31:27 +0000 (20:31 -0400)
commitfa817cc0ea21a4b28b7a076eab0b42010279fbc9
treedffbe841faa45b1631370d43ec13645cf64e55f0
parent8eb4ea7f609052333514919d38fd98780d57f243
Bypass declared_attr w/ a custom wrapper for lambda criteria

Fixed bug in new :func:`_orm.with_loader_criteria` feature where using a
mixin class with :func:`_orm.declared_attr` on an attribute that were
accessed inside the custom lambda would emit a warning regarding using an
unmapped declared attr, when the lambda callable were first initialized.
This warning is now prevented using special instrumentation for this
lambda initialization step.

Fixes: #6320
Change-Id: I18ce0c662131f2e683b84caa38c01b2182eb210b
doc/build/changelog/unreleased_14/6320.rst [new file with mode: 0644]
lib/sqlalchemy/orm/util.py
test/orm/test_relationship_criteria.py