-
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 postgres_conn_id to template fields in PostgresOperator #30778
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)
|
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.
postgres_conn_id
is provided to super as conn_id
which is already a template field, I'll test it to decide if it already possible or we need to do it in another way
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.
this can do the job, can you test it?
@@ -42,7 +42,7 @@ class PostgresOperator(SQLExecuteQueryOperator): | |||
For example, you could set the schema via `{"search_path": "CUSTOM_SCHEMA"}`. | |||
""" | |||
|
|||
template_fields: Sequence[str] = ("sql",) | |||
template_fields: Sequence[str] = ("sql", "postgres_conn_id") |
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.
template_fields: Sequence[str] = ("sql", "postgres_conn_id") | |
template_fields: Sequence[str] = ("sql", "conn_id") |
BTW, this operator is deprecated: airflow/airflow/providers/postgres/operators/postgres.py Lines 85 to 91 in f20d040
|
closing in favor of #30784 |
Add
postgres_conn_id
to the template fields for thePostgresOperator
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.rst
or{issue_number}.significant.rst
, in newsfragments.