Resolve S3ToRedshiftOperator connection and kwargs after template rendering - #70486
Merged
Merged
Conversation
…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.
mitre88
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl,
o-nikolas and
potiuk
as code owners
July 27, 2026 00:19
uranusjr
approved these changes
Jul 27, 2026
vincbeck
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aws_conn_idandredshift_data_api_kwargsare template fields ofS3ToRedshiftOperator, but__init__applied logic to both before Jinja rendering:aws_conn_idintoself._aws_conn_id, so a templated connection id was used verbatim at execute time;sql,parameters) never saw a templated kwargs dict.Both now run at the top of
execute()as locals (conn_set/aws_conn_idwere only read fromexecute()), 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?
Generated-by: Claude Code (Fable 5) following the guidelines