diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-27 16:48:25 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-29 01:07:53 -0400 |
| commit | e7e09649761cfb4afc242c541ab403258e75edd5 (patch) | |
| tree | daa3360ec06e4c10dd2efcc80f4f51198c7b7424 /lib/sqlalchemy/testing | |
| parent | 1329037bfed428e458547824a861ce1aa9df0c78 (diff) | |
| download | sqlalchemy-e7e09649761cfb4afc242c541ab403258e75edd5.tar.gz | |
improve natural_path usage in two places
Fixed loader strategy pathing issues where eager loaders such as
:func:`_orm.joinedload` / :func:`_orm.selectinload` would fail to traverse
fully for many-levels deep following a load that had a
:func:`_orm.with_polymorphic` or similar construct as an interim member.
Here we can take advantage of 2.0's refactoring of strategy_options
to identify the "chop_path" concept can be simplified to work
with "natural" paths alone.
In addition, identified existing
logic in PropRegistry that works fine, but needed the "is_unnatural"
attribute to be more accurate for a given path, so we set that
up front to True if the ancestor is_unnatural.
Fixes: #9715
Change-Id: Ie6b3f55b6a23d0d32628afd22437094263745114
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/fixtures.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py index fc1fa1483..bff251b0f 100644 --- a/lib/sqlalchemy/testing/fixtures.py +++ b/lib/sqlalchemy/testing/fixtures.py @@ -13,6 +13,7 @@ import itertools import random import re import sys +from typing import Any import sqlalchemy as sa from . import assertions @@ -675,7 +676,7 @@ class MappedTest(TablesTest, assertions.AssertsExecutionResults): # 'once', 'each', None run_setup_mappers = "each" - classes = None + classes: Any = None @config.fixture(autouse=True, scope="class") def _setup_tables_test_class(self): |
