-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Add a new parameter to SQL operators to specify conn id field #30784
Add a new parameter to SQL operators to specify conn id field #30784
Conversation
I am afraid this change is not backwards-compatible with the old common.sql providers. We have to remember that we have potentially complex relation between SQL providers and common.sql - and one can have common.sql 1.0 and latest databricks for example. There are two ways of handling it:
BTW. This is the main reason why we want to make sure common.sql provider is 100% backwards compatible - for all the providers - because the moment we make common.sql == 2.0.0, it with some breaking chnages, it will mean that if one provider will start using features from 2.0 and require it, all the other providers will also need to be upgraded which might be undesireable and we loose the "you can upgrade/downgrde providers independently" property. |
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.
We need to take care about backwards-compatibility
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
d278a42
to
391f345
Compare
@potiuk This PR is ready and fully b/c:
|
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.
❤️ it. Looks cool and safe.
related: #30778
curretly for the operators sub class of
BaseOperator
, we provide the field value to super asconn_id
which is a template field, and the field is rendered in execution time and everything works fine, but in therendered-templates
view, we have the original field name with the jinja template before rendering.This PR add a new field for
BaseOperator
to specify the conn field name, and use it directly from the ancestor with needing to provide it to parent class, then we can add the new conn field name totemplate_fields
to render it.Before:

After:

And they both works fine in the hook.
P.S: I just update the not deprecated operators, and this change is b/c, so if the new field is not defined, and the
conn_id
is provider to parent class, it will work as before.