]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
disable raiseerr for refresh state loader options
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Nov 2021 17:46:25 +0000 (12:46 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Nov 2021 17:46:25 +0000 (12:46 -0500)
commitd4c170238dc95eeb2dc7e6c5e03270fbc8b36f8f
treeb5efb43fdbfb5eaa80b4cc768471313e4e93f8e9
parent9141b6c15eac4827f0df2e3f87f331c821d13b5a
disable raiseerr for refresh state loader options

Fixed ORM regression where the new behavior of "eager loaders run on
unexpire" added in :ticket:`1763` would lead to loader option errors being
raised inappropriately for the case where a single :class:`_orm.Query` or
:class:`_sql.Select` were used to load multiple kinds of entities, along
with loader options that apply to just one of those kinds of entity like a
:func:`_orm.joinedload`, and later the objects would be refreshed from
expiration, where the loader options would attempt to be applied to the
mismatched object type and then raise an exception. The check for this
mismatch now bypasses raising an error for this case.

Fixes: #7318
Change-Id: I111e0f3e0fb0447355574cbdcde002f734833490
doc/build/changelog/unreleased_14/7318.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_expire.py