]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
InstanceState default path is RootRegistry, not tuple
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jan 2020 21:27:26 +0000 (16:27 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jan 2020 22:17:02 +0000 (17:17 -0500)
commit3c74e877aa28fc0a840d281f6b3b3d059a42b5bf
tree8ec16204db5546db26c52f042fa062eff844d61b
parent98b4af9ce27549c04ffad6443f3d5e3c1f7601fb
InstanceState default path is RootRegistry, not tuple

Fixed regression caused in 1.3.13 by :ticket:`5056` where a refactor of the
ORM path registry system made it such that a path could no longer be
compared to an empty tuple, which can occur in a particular kind of joined
eager loading path.   The "empty tuple" use case has been resolved so that
the path registry is compared to a path registry in all cases;  the
:class:`.PathRegistry` object itself now implements ``__eq__()`` and
``__ne__()`` methods which will take place for all equality comparisons and
continue to succeed in the not anticipated case that a non-
:class:`.PathRegistry` object is compared, while emitting a warning that
this object should not be the subject of the comparison.

Fixes: #5110
Change-Id: I6cab6cd771c131d12b17939b369212f12c6bee16
(cherry picked from commit f5eeac3d18892206abcaa30a295d12a799a8fb9b)
doc/build/changelog/unreleased_13/5110.rst [new file with mode: 0644]
lib/sqlalchemy/orm/path_registry.py
lib/sqlalchemy/orm/state.py
test/orm/test_loading.py
test/orm/test_utils.py