Fix EcsRunTaskOperator deferred-logs region and template field init - #70464
Merged
shahar1 merged 1 commit intoJul 26, 2026
Merged
Conversation
Template fields are rendered after operator construction, so constructor-time reads can act on unresolved Jinja values. Keeping these decisions in the execution path lets templated values resolve before they affect ECS log handling.
fat-catTW
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl,
o-nikolas and
potiuk
as code owners
July 26, 2026 08:42
shahar1
approved these changes
Jul 26, 2026
2 tasks
Contributor
|
Nice! You might haven't notice, but you probably fixed another bug as well :) |
Contributor
Author
|
Thanks! |
1 task
Kunal8954
pushed a commit
to Kunal8954/airflow
that referenced
this pull request
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.
Move
EcsRunTaskOperatortemplate-field decisions out of__init__so templated values are rendered before they affect ECS log handling.This removes the operator from the
validate_operators_initexemption list.Besides moving the template-field logic out of
__init__(so templated awslogs_region/region_name values are rendered before they take effect), this also fixes a real bug in the deferrable path:execute_completebuilt itsAwsLogsHookwithregion_name=self.region_name, so whenawslogs_regionwas explicitly set to a different region than the task's region, the final log fetch after deferral queried CloudWatch in the wrong region and found no log stream. The newresolve_awslogs_region()helper is now the single place the log region is resolved (explicitawslogs_region, falling back toregion_name), and bothexecute_completeand the task log fetcher use it. Note this covers only the post-deferral fetch — log forwarding during deferral still uses the task region insideTaskDoneTrigger; that remaining half is tracked in #70465.related: #70296
Was generative AI tooling used to co-author this PR?
[X]Yes (please specify the tool below)Generated-by: [Codex] following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.