syedahsn commented on PR #25717:
URL: https://github.com/apache/airflow/pull/25717#issuecomment-1303219879
This PR is causing the `RedshiftSQLOperator` to fail with the message
```
AttributeError: 'RedshiftSQLOperator' object has no attribute
'redshift_conn_id'
--
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/airflow/airflow/models/taskinstance.py", line 1450, in
_run_raw_task
self._execute_task_with_callbacks(context, test_mode)
File "/opt/airflow/airflow/models/taskinstance.py", line 1569, in
_execute_task_with_callbacks
task_orig = self.render_templates(context=context)
File "/opt/airflow/airflow/models/taskinstance.py", line 2184, in
render_templates
original_task.render_template_fields(context)
File "/opt/airflow/airflow/models/baseoperator.py", line 1196, in
render_template_fields
self._do_render_template_fields(self, self.template_fields, context,
jinja_env, set())
File "/opt/airflow/airflow/utils/session.py", line 75, in wrapper
return func(*args, session=session, **kwargs)
File "/opt/airflow/airflow/models/abstractoperator.py", line 405, in
_do_render_template_fields
f"{attr_name!r} is configured as a template field "
AttributeError: 'redshift_conn_id' is configured as a template field but
RedshiftSQLOperator does not have this attribute.
```
The reason seems to be the fact that the `redshift_conn_id` attribute in the
`RedshiftSQLOperator` was a tempate field, but now that it no longer exists, it
is causing issues.
In terms of maintaining backward compatibility, should we introduce the
attribute back to the `RedshiftSQLOperator` to resolve the issue? Or is there a
better approach? I'd love to hear other opinions on this. Thanks!
@eladkal @kazanzhy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]