summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2022-05-25 16:44:50 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2022-05-25 16:44:50 +0000
commitb4631ee81a6463012fd09c9be3a5e13e370771a7 (patch)
tree2af4c77cab5da5aa7c7bb71f098b8d22dc6169f5 /lib/sqlalchemy/sql/compiler.py
parente6792a3db7825f360df65a62f245087aec0a3e27 (diff)
parenta5d481eaa5bff958692fc3b0024f0b9b1c4f56c6 (diff)
downloadsqlalchemy-b4631ee81a6463012fd09c9be3a5e13e370771a7.tar.gz
Merge "apply bindparam escape name to processors dictionary" into main
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 0eae31a1a..63ed45a96 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1143,10 +1143,18 @@ class SQLCompiler(Compiled):
str, Union[_BindProcessorType[Any], Sequence[_BindProcessorType[Any]]]
]:
+ _escaped_bind_names = self.escaped_bind_names
+ has_escaped_names = bool(_escaped_bind_names)
+
# mypy is not able to see the two value types as the above Union,
# it just sees "object". don't know how to resolve
return dict(
- (key, value) # type: ignore
+ (
+ _escaped_bind_names.get(key, key)
+ if has_escaped_names
+ else key,
+ value,
+ ) # type: ignore
for key, value in (
(
self.bind_names[bindparam],