]> 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 17:07:06 +0000 (13:07 -0400)
commit293b0e3dd8205185b84cd3baf2f078348437d245
tree062f2c6e0c820a631df4d551d4385b9d67b5f18e
parent258d07e478eab9ee385f36a5c5fd56c56bf7dfea
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
doc/build/changelog/unreleased_14/8109.rst [new file with mode: 0644]
lib/sqlalchemy/orm/_orm_constructors.py
lib/sqlalchemy/orm/util.py
test/orm/test_pickled.py