]> 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:16:51 +0000 (17:16 -0500)
commitf5eeac3d18892206abcaa30a295d12a799a8fb9b
tree4510849dd349f60138f67d544f5048e13bfd0e2e
parent4bf97e41b2d18b86fc7c0bba6acd50e2b58a4a70
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
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