-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add 'parameters' to DatabricksSQLOperator template_fields #32263
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 'parameters' to DatabricksSQLOperator template_fields #32263
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
|
||
| template_fields: Sequence[str] = tuple( | ||
| {"_output_path", "schema", "catalog", "http_headers", "databricks_conn_id"} | ||
| {"_output_path", "schema", "catalog", "http_headers", "databricks_conn_id", "parameters"} |
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.
Why? This field is templated from the parent class doesnt it?
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.
Nope. new fields override the old ones unless you add smth like:
template_fields = tuple({"new_field", "new_field2"} | set(ParentOperator.template_fields))
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.
Not worth it in this case.
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.
But that is exactly what we do :)
See the line below in the code.
This is the change I made earlier today
#32253
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.
🤦 🤦
Reminder to self: Always look the line below as well.
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.
(I was just looking at the snippet in the conversation - that's why).
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.
|
Closing as functionality already exist |
Adds 'parameters' to the list of templated fields for the DatabricksSQLOperator. 'parameters' are used to render the sql statement. Parameters is passed to the parent class SQLExecuteQueryOperator and it templated.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.