]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
suppport with_loader_criteria pickling w/ fixed callable
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Jun 2022 17:05:20 +0000 (13:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Jun 2022 22:02:35 +0000 (18:02 -0400)
commit70fbce17cda3fd9ea36febae6b93c3c5877f367f
treef2f74f4264e6579749f629f80e1cf7791740b8e3
parent3f73cc2291906d3c4102173f6020529b705f55ee
suppport with_loader_criteria pickling w/ fixed callable

Fixed issue where a :func:`_orm.with_loader_criteria` option could not be
pickled, as is necessary when it is carried along for propagation to lazy
loaders in conjunction with a caching scheme. Currently, the only form that
is supported as picklable is to pass the "where criteria" as a fixed
module-level callable function that produces a SQL expression. An ad-hoc
"lambda" can't be pickled, and a SQL expression object is usually not fully
picklable directly.

Fixes: #8109
Change-Id: I49fe69088b0c7e58a0f22c67d2ea4e33752a5a73
(cherry picked from commit 293b0e3dd8205185b84cd3baf2f078348437d245)
doc/build/changelog/unreleased_14/8109.rst [new file with mode: 0644]
lib/sqlalchemy/orm/util.py
test/orm/test_pickled.py