Skip to content

Commit

Permalink
fix: avoid scribbling on (reused) bind param (#365)
Browse files Browse the repository at this point in the history
Closes #357.
  • Loading branch information
tseaver committed Oct 26, 2021
1 parent 7f1ce80 commit d28cac5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sqlalchemy_bigquery/base.py
Expand Up @@ -471,8 +471,14 @@ def visit_bindparam(
# The NullType/known-type check has to do with some extreme
# edge cases having to do with empty in-lists that get special
# hijinks from SQLAlchemy that we don't want to disturb. :)
#
# Note that we do *not* want to overwrite the "real" bindparam
# here, because then we can't do a recompile later (e.g., first
# print the statment, then execute it). See issue #357.
#
if getattr(bindparam, "expand_op", None) is not None:
assert bindparam.expand_op.__name__.endswith("in_op") # in in
bindparam = bindparam._clone(maintain_key=True)
bindparam.expanding = False
unnest = True

Expand Down

0 comments on commit d28cac5

Please sign in to comment.