Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d28cac5

Browse filesBrowse files
authored
fix: avoid scribbling on (reused) bind param (googleapis#365)
Closes googleapis#357.
1 parent 7f1ce80 commit d28cac5
Copy full SHA for d28cac5

File tree

1 file changed

+6
-0
lines changed
Filter options

1 file changed

+6
-0
lines changed

‎sqlalchemy_bigquery/base.py

Copy file name to clipboardExpand all lines: sqlalchemy_bigquery/base.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,14 @@ def visit_bindparam(
471471
# The NullType/known-type check has to do with some extreme
472472
# edge cases having to do with empty in-lists that get special
473473
# hijinks from SQLAlchemy that we don't want to disturb. :)
474+
#
475+
# Note that we do *not* want to overwrite the "real" bindparam
476+
# here, because then we can't do a recompile later (e.g., first
477+
# print the statment, then execute it). See issue #357.
478+
#
474479
if getattr(bindparam, "expand_op", None) is not None:
475480
assert bindparam.expand_op.__name__.endswith("in_op") # in in
481+
bindparam = bindparam._clone(maintain_key=True)
476482
bindparam.expanding = False
477483
unnest = True
478484

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.