]> 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:47:19 +0000 (12:47 -0500)
commit708ef651fab532c430d4b20dc50e97c377d48d5e
tree3f20170abff9418cdb56780936ed4960477e4212
parentb2b759bdaef3bfc45f89d4e151e298693910dec2
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
(cherry picked from commit d4c170238dc95eeb2dc7e6c5e03270fbc8b36f8f)
doc/build/changelog/unreleased_14/7318.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_expire.py