From becab22dcbe9d68b0671a9246e022c9810f7e319 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 21 Mar 2020 17:26:24 -0400 Subject: Test instance for matching class hierarchy on get_from_identity Fixed issue where a lazyload that uses session-local "get" against a target many-to-one relationship where an object with the correct primary key is present, however it's an instance of a sibling class, does not correctly return None as is the case when the lazy loader actually emits a load for that row. Fixes: #5210 Change-Id: I89f9946cfeba61d89a272435f76a5a082b1da30c --- lib/sqlalchemy/orm/attributes.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/sqlalchemy/orm/attributes.py') diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index a959b0a40..5ca2858e9 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -34,6 +34,7 @@ from .base import NO_CHANGE # noqa from .base import NO_RAISE from .base import NO_VALUE from .base import NON_PERSISTENT_OK # noqa +from .base import PASSIVE_CLASS_MISMATCH # noqa from .base import PASSIVE_NO_FETCH from .base import PASSIVE_NO_FETCH_RELATED # noqa from .base import PASSIVE_NO_INITIALIZE -- cgit v1.2.1