diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-14 14:34:05 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-14 14:34:05 -0400 |
commit | 35f82173e04b3209e07fcfc0606a7614108d018e (patch) | |
tree | 11926618658661f64dfb18045c405841145c16bd /lib/sqlalchemy/sql/compiler.py | |
parent | 46ddbd344b41f24e1fc72a89f8613f4a2e3ec44e (diff) | |
download | sqlalchemy-35f82173e04b3209e07fcfc0606a7614108d018e.tar.gz |
move compiler / pool critical casts away
callcount tests were being impacted by a few cast() calls,
move them behind TYPE_CHECKING
Change-Id: I633bbfe55313db94ebb22f87cc4216f8e50d807e
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index f28dceefc..db88496a0 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -48,6 +48,7 @@ from typing import Sequence from typing import Set from typing import Tuple from typing import Type +from typing import TYPE_CHECKING from typing import Union from . import base @@ -1767,7 +1768,9 @@ class SQLCompiler(Compiled): else: schema_prefix = "" - tablename = cast("NamedFromClause", table).name + if TYPE_CHECKING: + assert isinstance(table, NamedFromClause) + tablename = table.name if ( not effective_schema |