-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass kwargs through to get_function_sql
#791
Comments
This also requires a change to get_function_sql(self: Function, subquery: Any = None, with_alias: Any = None, **kwargs: Any) -> str:
special_params_sql = self.get_special_params_sql(**kwargs)
return "{name}({args}{special})".format(
name=self.name,
args=",".join(
p.get_sql(with_alias=False, subquery=True, **kwargs)
if hasattr(p, "get_sql")
else self.get_arg_sql(p, **kwargs)
for p in self.args
),
special=(" " + special_params_sql) if special_params_sql else "",
) |
Would you like to make a PR? |
Gladly, done. |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kwargs are passed around everywhere except in
Function.get_sql
.I've implemented a parameter wrapper to ensure I can build parametrized queries, but this doesn't work on functions because of this simple issue.
https://github.com/kayak/pypika/blob/master/pypika/terms.py#L1336
The text was updated successfully, but these errors were encountered: