summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/typing.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-11-21 08:51:34 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-11-21 08:52:12 -0500
commitece524c0059d0814e45f4bba63abebd7e9af4b8b (patch)
tree4985177fae442ffea84ef0953a964c1fe4b1b1fe /lib/sqlalchemy/util/typing.py
parent46e6693cb3db445f18aa25d5e4ca613504bd12b3 (diff)
downloadsqlalchemy-ece524c0059d0814e45f4bba63abebd7e9af4b8b.tar.gz
fall back to eval() for names that have dots
Fixed regression in 2.0.0b3 caused by :ticket:`8759` where indicating the :class:`.Mapped` name using a qualified name such as ``sqlalchemy.orm.Mapped`` would fail to be recognized by Declarative as indicating the :class:`.Mapped` construct. Fixes: #8853 Change-Id: Iddb6efaae864d4545e80c54658244670f81ef6cc
Diffstat (limited to 'lib/sqlalchemy/util/typing.py')
-rw-r--r--lib/sqlalchemy/util/typing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/typing.py b/lib/sqlalchemy/util/typing.py
index 9eb761eff..20ad148f8 100644
--- a/lib/sqlalchemy/util/typing.py
+++ b/lib/sqlalchemy/util/typing.py
@@ -141,6 +141,8 @@ def eval_expression(expression: str, module_name: str) -> Any:
def eval_name_only(name: str, module_name: str) -> Any:
+ if "." in name:
+ return eval_expression(name, module_name)
try:
base_globals: Dict[str, Any] = sys.modules[module_name].__dict__