Skip to content

Resolve S3ToRedshiftOperator connection and kwargs after template rendering - #70486

Merged
vincbeck merged 1 commit into
apache:mainfrom
mitre88:fix-s3-to-redshift-template
Jul 27, 2026
Merged

Resolve S3ToRedshiftOperator connection and kwargs after template rendering#70486
vincbeck merged 1 commit into
apache:mainfrom
mitre88:fix-s3-to-redshift-template

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

aws_conn_id and redshift_data_api_kwargs are template fields of S3ToRedshiftOperator, but __init__ applied logic to both before Jinja rendering:

  • the NOTSET/default resolution captured the un-rendered aws_conn_id into self._aws_conn_id, so a templated connection id was used verbatim at execute time;
  • the forbidden-keys check (sql, parameters) never saw a templated kwargs dict.

Both now run at the top of execute() as locals (conn_set / aws_conn_id were only read from execute()), and the existing kwargs test asserts the failure at execute time. Removes the class from the exemption list.

related: #70296


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

…dering

aws_conn_id and redshift_data_api_kwargs are template fields, but the
default-connection resolution and the sql/parameters kwargs check ran in
__init__, before Jinja rendering — a templated aws_conn_id was captured
un-rendered and templated kwargs escaped validation. Both now run in
execute() on rendered values.
@vincbeck
vincbeck merged commit e1f17e7 into apache:main Jul 27, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants