summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext
diff options
context:
space:
mode:
authorHiroshi Ogawa <hi.ogawa.zz@gmail.com>2021-10-01 18:59:22 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-10-05 12:49:04 -0400
commit90d2f087c8c75289d8a8c819a9aebfcda5b98b96 (patch)
tree2ff83606cce8896af0f3b2bb881e743c3df25c57 /lib/sqlalchemy/ext
parentbb3560851280d338ffb03b72da25488f7db34d22 (diff)
downloadsqlalchemy-90d2f087c8c75289d8a8c819a9aebfcda5b98b96.tar.gz
fix(6435): support `MemberExpr` for enum column declaration
Fixed issue in mypy plugin to improve upon some issues detecting ``Enum()`` SQL types containing custom Python enumeration classes. Pull request courtesy Hiroshi Ogawa. Fixes: #6435 Closes: #7048 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7048 Pull-request-sha: 59f5c89688792f6af3b07488d5cf97f8f2e964dc Change-Id: I05adbec74ceac1ecfdc5a242bfe7aa4b2eb805e4
Diffstat (limited to 'lib/sqlalchemy/ext')
-rw-r--r--lib/sqlalchemy/ext/mypy/infer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/mypy/infer.py b/lib/sqlalchemy/ext/mypy/infer.py
index 52570f772..6d243b6ec 100644
--- a/lib/sqlalchemy/ext/mypy/infer.py
+++ b/lib/sqlalchemy/ext/mypy/infer.py
@@ -521,7 +521,7 @@ def extract_python_type_from_typeengine(
) -> ProperType:
if node.fullname == "sqlalchemy.sql.sqltypes.Enum" and type_args:
first_arg = type_args[0]
- if isinstance(first_arg, NameExpr) and isinstance(
+ if isinstance(first_arg, RefExpr) and isinstance(
first_arg.node, TypeInfo
):
for base_ in first_arg.node.mro: