]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
remove "undefer_pks" as a strategy option
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Jun 2022 15:44:45 +0000 (11:44 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Jun 2022 16:27:03 +0000 (12:27 -0400)
commitf003360baa28f1bf65134eac2727a0fcea43d5c8
treeb2195d6057220a4808668d4d5e51a796663f8642
parentb171f5d2e488c46a664847644e65d5dc03759840
remove "undefer_pks" as a strategy option

The behavior of :func:`_orm.defer` regarding primary key and "polymorphic
discriminator" columns is revised such that these columns are no longer
deferrable, either explicitly or when using a wildcard such as
``defer('*')``. Previously, a wildcard deferral would not load
PK/polymorphic columns which led to errors in all cases, as the ORM relies
upon these columns to produce object identities. The behavior of explicit
deferral of primary key columns is unchanged as these deferrals already
were implicitly ignored.

Fixes: #7495
Change-Id: I76d9252426e86619bc142667670a3df75b4f5f6a
doc/build/changelog/unreleased_20/7495.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_deferred.py
test/orm/test_deprecations.py