-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Defer to hook setting for split_statements in SQLExecuteQueryOperator #28635
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
Defer to hook setting for split_statements in SQLExecuteQueryOperator #28635
Conversation
|
I don't think this breaks any backcompat because for most providers this is no change and, for snowflake , if you try to submit multistatement r.n. with defaults it will just fail (and this effectively restores the behavior prior to the big sql refactor) |
We should be very explicit about this in the release notes though if we merge this change (which I am in favor of), because it potentially alters DAG behavior. |
9a9644f to
405ed43
Compare
Some databases, such as snowflake, require you to split statements in order to submit multi-statement sql. For such databases, splitting is the natural default, and we should defer to the hook to control that.
faaad8a to
1035a2a
Compare
| if self.split_statements is not None: | ||
| extra_kwargs = {"split_statements": self.split_statements} | ||
| else: | ||
| extra_kwargs = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if self.split_statements is not None: | |
| extra_kwargs = {"split_statements": self.split_statements} | |
| else: | |
| extra_kwargs = {} | |
| extra_kwargs = {"split_statements": self.split_statements} if self.split_statements else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the suggestion. current form is result of TP's suggestion. just gonna leave it as is.
Some databases, such as snowflake, require you to split statements in order to submit multi-statement sql. For such databases, splitting is the natural default and most intuitive setting, and we should defer to the hook to control that.
cc @potiuk @eladkal @kazanzhy @pgagnon